Wednesday, April 4, 2007

Create Home Page Shortcut Desktop

Imports System.IO
Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
Private Sub InitializeComponent()

End Sub
Protected WithEvents Bt As System.Web.UI.HtmlControls.HtmlInputButton

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region
Dim s As String
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Const fsoForWriting = 2
s = "www.Google.com"
Dim objFSO
objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Open the text file
Dim objTextStream
objTextStream = objFSO.OpenTextFile("C:\Documents and Settings\All Users\Desktop\HomePage.url", fsoForWriting, True)
objTextStream.WriteLine("[InternetShortcut")
objTextStream.WriteLine("URL=" & s)
objTextStream.WriteLine("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
'Close the file and clean up
objTextStream.Close()
objTextStream = Nothing
objFSO = Nothing
End Sub

Private Sub Bt_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bt.ServerClick
End Sub
End Class





No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.