Om jag vill ha sökvägen ut på nätet hur gör man då ? Sök på xmlhttp i forumet så hittar du inlägg som kan vara till hjälp.Sökväg för en nyare version
Ex. http://hus.katalog.com/version.dat
Detta fungerar ju om filerna ligger samma katalog
Open App.Path & "\version.dat" For Output As #1
Version = App.Major & "." & App.Minor
Print #1, Version
Close #1
SörenSv: Sökväg för en nyare version
Eller så kan du klistra in följande api anrop i en modul:
<code>
Option Explicit
Private Const UserAgent As String = "VB: ReadURL()"
Private Const INTERNET_OPEN_TYPE_DIRECT As Long = 1&
Private Const INTERNET_OPEN_TYPE_PROXY As Long = 3&
Private Const INTERNET_FLAG_RELOAD As Long = &H80000000
Private Declare Function InternetOpen Lib "wininet" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet" (ByRef hInet As Long) As Long
Private Declare Function InternetReadFile Lib "wininet" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
Private Declare Function InternetOpenUrl Lib "wininet" Alias "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String, ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
Public Function ReadURL(URL As String, Optional BufferSize As Long = 1024) As String
Dim hOpen As Long
Dim hFile As Long
Dim Buffer As String
Dim Ret As Long
hOpen = InternetOpen(UserAgent, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, 0)
If hOpen Then
hFile = InternetOpenUrl(hOpen, URL, vbNullString, ByVal 0&, INTERNET_FLAG_RELOAD, ByVal 0&)
If hFile Then
Buffer = Space(BufferSize)
If InternetReadFile(hFile, Buffer, BufferSize, Ret) Then
ReadURL = Left(Buffer, Ret)
End If
InternetCloseHandle hFile
End If
InternetCloseHandle hOpen
End If
End Function
</code>
Du anropar den sedan på följande sätt:
<code>
Version = ReadURL("http://hus.katalog.com/version.dat")
</code>