VB.Net Tutorial/Stream File/SpecialDirectories

Материал из VB Эксперт
Перейти к: навигация, поиск

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