zoukankan      html  css  js  c++  java
  • Get temp path via windows API

    Private Const MAX_PATH As Long = 260
    Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nSize As Long, ByVal lpBuffer As String) As Long

    Public Function GetTempDir() As String

        Dim nSize As Long
        Dim buff As String
        buff = Space$(MAX_PATH)
        nSize = Len(buff)
        Call GetTempPath(nSize, buff)
        GetTempDir = TrimNull(buff)
    End Function

    Private Function TrimNull(item As String)

        Dim pos As Integer
       '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

     

    Private Sub WriteOutput()

        Dim i As Long
        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

  • 相关阅读:
    poj1328
    xml入门简介--两天学会xml
    php的一些特殊用法
    数据结构(一)
    队列的 基本操作
    栈的 基本操作
    线性表----单链表
    线性表----顺序表
    数据结构
    链式队列
  • 原文地址:https://www.cnblogs.com/pengpenghappy/p/3897669.html
Copyright © 2011-2022 走看看