Get temp path via windows API
2020-12-13 06:08
标签:os io for ar cti size window ef Private Const MAX_PATH As Long = 260 Public Function GetTempDir() As String Dim nSize As Long Private Function TrimNull(item As String) Dim pos As Integer Private Sub WriteOutput() Dim i As Long Get temp path via windows API,搜素材,soscw.com Get temp path via windows API 标签:os io for ar cti size window ef 原文地址:http://www.cnblogs.com/pengpenghappy/p/3897669.html
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nSize As Long, ByVal lpBuffer As String) As Long
Dim buff As String
buff = Space$(MAX_PATH)
nSize = Len(buff)
Call GetTempPath(nSize, buff)
GetTempDir = TrimNull(buff)
End Function
‘double check that there is a chr$(0) in the string
pos = InStr(item, Chr$(0))
If pos Then
TrimNull = Left$(item, pos - 1)
Else
TrimNull = item
End If
End Function
Dim level As Long
level = 0
Dim Child As IXMLDOMNode
‘output as xml
Dim tempPath As String
tempPath = GetTempDir()
tempPath = tempPath + "test.xml"
Open tempPath For Output As #1
Print #1, m_Batch.xml
Close #1
End Sub
文章标题:Get temp path via windows API
文章链接:http://soscw.com/essay/32550.html