here's a working example of those API calls:
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" _
(ByVal nBufferLength As Long, _
ByVal lpBuffer As String) As Long
Private Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" _
(ByVal lpszPath As String, _
ByVal lpPrefixString As String, _
ByVal wUnique As Long, _
ByVal lpTempFileName As String) As Long
Private Sub Form_Load()
Dim sFileName As String
Dim sTempDir As String
Dim stemp As String
Dim sFilePrefix As String
sTempDir = Space(100)
Call GetTempPath(CLng(100), sTempDir)
MsgBox Trim(sTempDir)
sFilePrefix = "JDP" 'change this to whatever you want. it can be blank too.
'Create a buffer
sFileName = String(260, 0)
'Get a temporary filename
GetTempFileName sTempDir, sFilePrefix, 0, sFileName
'Remove all the unnecessary chr$(0)'s
sFileName = Left$(sFileName, InStr(1, sFileName, Chr$(0)) - 1)
MsgBox sFileName
End Sub
i couldn't find my working example, so i just wrote it again. this also uses the
GetTempPath - which get's the system's temp directory. you can supply any path you
want though.
good luck,
john
--- mahesh.kava@p... wrote:
> Thanks to john & kim
> i am now navigating to the url getting the text & displaying it in a
> notepad.john,can u tell me the name of the api which creates temporary
> files.
> regds
> Mahesh
John Pirkey
MCSD
John@S...
http://www.stlvbug.org