ADO DOT NET
Centurion
- Joined
- Dec 20, 2006
- Messages
- 160
Hi everybody
I wanna create a folder in My Documents, named "My Information" for example!
And customize its ICON by placing a "Desktop.ini" file into that.
So I wrote this code which works perfect, but I don't know why it does not show the ICON as expected
I wanna create a folder in My Documents, named "My Information" for example!
And customize its ICON by placing a "Desktop.ini" file into that.
So I wrote this code which works perfect, but I don't know why it does not show the ICON as expected
Visual Basic:
'Create Directory
If Not My.Computer.FileSystem.DirectoryExists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\My Information") Then
System.IO.Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\My Information")
End If
'Create File
Dim FileContent As String = "[.ShellClassInfo]" + vbNewLine + "IconFile=%ProgramFiles%\Company\Product\Program.exe" + vbNewLine + "IconIndex=0" + vbNewLine + "InfoTip=Information collected using our application"
If Not My.Computer.FileSystem.FileExists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\My Information\Desktop.ini") Then
My.Computer.FileSystem.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\My Information\Desktop.ini", FileContent, False)
End If
Dim FileDetail As IO.FileInfo = My.Computer.FileSystem.GetFileInfo(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\My Information\Desktop.ini")
FileDetail.Attributes = IO.FileAttributes.Hidden + IO.FileAttributes.System