鼻腔检查多少钱:请教一个VB的简单问题!
来源:百度文库 编辑:杭州交通信息网 时间:2024/06/08 15:01:40
请各位高手教教我~~~谢谢!
用GetWindowsDirectory函数可以寻找Windows目录
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String,ByVal nSize As Long) As Long
Private Sub Form_load
Dim strBuffer As String *1024
retVal=GetWindowsDirectory(strBuffer,1024)
label1.caption="Windows directory:"&strBuffer
are you know?
''先声明一个函数..
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
''Public Function GetWindowsPath() As String
Dim p As String * 80
Dim length As Long
Dim path As String
length = GetWindowsDirectory(p, Len(p))
path = Left(p, length)
GetWindowsPath = path
End Function
''获取
Private Sub Command1_Click()
text1.text = GetWindowsPath
End Sub
懂了没.我调试过的.