得到显示器分辨率 Dim X As Short = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width Dim Y As Short = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height MsgBox("您的显示器分辨率是:" & X & " X " & Y)得到特殊文件夹的路径 '"Desktop"桌面文件夹路径 MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)) '"Favorites"收藏夹路径 MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.Favorites)) '"Application Data"路径 MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData))'通用写法 'Dim SPEC As String = Environment.GetFolderPath(Environment.SpecialFolder.XXXXXXX) 'XXXXXXX是特殊文件夹的名字得到操作系统版本信息 MsgBox(Environment.OSVersion.ToString)得到当前登录的用户名 MsgBox(Environment.UserName)得到当前应用程序的路径 MsgBox(Environment.CurrentDirectory)MsgBox可以换为C#目前版本的如:MessageBox.Show.....
Application.StartupPath;
System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;//应用程序的路径和文件名
Dim X As Short = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width
Dim Y As Short = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height
MsgBox("您的显示器分辨率是:" & X & " X " & Y)得到特殊文件夹的路径
'"Desktop"桌面文件夹路径
MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))
'"Favorites"收藏夹路径
MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.Favorites))
'"Application Data"路径
MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData))'通用写法
'Dim SPEC As String = Environment.GetFolderPath(Environment.SpecialFolder.XXXXXXX)
'XXXXXXX是特殊文件夹的名字得到操作系统版本信息
MsgBox(Environment.OSVersion.ToString)得到当前登录的用户名
MsgBox(Environment.UserName)得到当前应用程序的路径
MsgBox(Environment.CurrentDirectory)MsgBox可以换为C#目前版本的如:MessageBox.Show.....
也成