日期:2012-08-04 浏览次数:20460 次
Public Class StopWatch Private mintStart As Integer Public Sub Start() mintStart = Environment.TickCount End Sub Public Function Elapsed() As Integer Return Environment.TickCount - mintStart End Function Public Overrides Function ToString() As String Return String.Format( _ "Started: {0}, Elapsed: {1}", _ mintStart, Me.Elapsed) End FunctionEnd Class
Private Sub FillProperties() AddItem("CurrentDirectory", _ Environment.CurrentDirectory) AddItem("MachineName", Environment.MachineName) AddItem("OSVersion.Platform", _ Environment.OSVersion.Platform.ToString) AddItem("OSVersion.Version", _ Environment.OSVersion.Version.ToString) AddItem("SystemDirectory", _ Environment.SystemDirectory) AddItem("UserDomainName", Environment.UserDomainName) AddItem("UserInteractive", _ Environment.UserInteractive) AddItem("UserName", Environment.UserName) AddItem("WorkingSet", Environment.WorkingSet)End Sub
Private Sub FillFolderList() Dim strName As String Dim astrNames() As String Dim aintValues As Array Dim i As Integer ' 使用 SpecialFolder 枚举中的名称 ' 填写 ListView 控件的第一列。 astrNames = System.Enum.GetNames( _ GetType(Environment.SpecialFolder)) aintValues = System.Enum.GetValues( _ GetType(Environment.SpecialFolder)) For i = 0 To astrNames.Length - 1 With lvwFolders.Items.Add(astrNames(i)) .SubItems.Add( _ Environment.GetFo