VB.Net Tutorial/Stream File/SpecialDirectories — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 12:56, 26 мая 2010
Содержание
- 1 Get files under My.Computer.FileSystem.SpecialDirectories.MyDocuments
- 2 My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
- 3 My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
- 4 My.Computer.FileSystem.SpecialDirectories.Desktop
- 5 My.Computer.FileSystem.SpecialDirectories.MyDocuments
- 6 My.Computer.FileSystem.SpecialDirectories.MyMusic
- 7 My.Computer.FileSystem.SpecialDirectories.MyPictures
- 8 My.Computer.FileSystem.SpecialDirectories.Programs
- 9 My.Computer.FileSystem.SpecialDirectories.Temp
Get files under My.Computer.FileSystem.SpecialDirectories.MyDocuments
Option Strict On
Imports System.IO
Public Module FileSystemAttributes
Public Sub Main()
Dim docPath As String = My.ruputer.FileSystem.SpecialDirectories.MyDocuments
For Each fn As String In My.ruputer.FileSystem.GetFiles(docPath)
Dim fi As FileInfo = New FileInfo(fn)
Console.WriteLine("{0}: {1}", fi.Name, fi.Attributes.ToString())
Next
End Sub
End Module
Default.rdp: Hidden, Archive desktop.ini: Hidden, System, Archive
My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.AllUsersApplicationData)
End Sub
End class
C:\Documents and Settings\All Users\Application Data\Test\Test\0.0.0.0
My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.CurrentUserApplicationData)
End Sub
End class
C:\Documents and Settings\Joe\Application Data\Test\Test\0.0.0.0
My.Computer.FileSystem.SpecialDirectories.Desktop
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.Desktop)
End Sub
End class
C:\Documents and Settings\Joe\Desktop
My.Computer.FileSystem.SpecialDirectories.MyDocuments
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.MyDocuments)
End Sub
End class
C:\Documents and Settings\Joe\My Documents
My.Computer.FileSystem.SpecialDirectories.MyMusic
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.MyMusic)
End Sub
End class
C:\Documents and Settings\Joe\My Documents\My Music
My.Computer.FileSystem.SpecialDirectories.MyPictures
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.MyPictures)
End Sub
End class
C:\Documents and Settings\Joe\My Documents\My Pictures
My.Computer.FileSystem.SpecialDirectories.Programs
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.Programs)
End Sub
End class
C:\Documents and Settings\Joe\Start Menu\Programs
My.Computer.FileSystem.SpecialDirectories.Temp
public class Test
public Shared Sub Main
Console.WriteLine(My.ruputer.FileSystem.SpecialDirectories.Temp)
End Sub
End class
C:\Documents and Settings\Joe\Local Settings\Temp