|
-
Jun 12th, 2009, 06:10 PM
#1
Thread Starter
Junior Member
Mobile FTP
Hi! I'm trying to send a SQLCe file form my WM6 phone to an ftp server. I'm getting a "NotSupportedException" error. I can't figure out what im doing wrong.
Any ideas!? thanks!
Code:
Private Declare Function InternetOpen Lib "wininet.dll" 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 InternetConnect Lib "wininet.dll" Alias "InternetConnectA" _
(ByVal hInternetSession As Long, ByVal sServerName As String, _
ByVal nServerPort As Integer, ByVal sUsername As String, _
ByVal sPassword As String, ByVal lService As Long, _
ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _
(ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _
ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, _
ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" _
(ByVal hFtpSession As Long, ByVal lpszLocalFile As String, _
ByVal lpszRemoteFile As String, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Public Sub UploadFile()
Dim lngINetConn
Dim lngINet
Dim blnrc
lngINet = InternetOpen("MyFTP Control", 1, vbNullString, vbNullString, 0)
'error happens before this point
lngINetConn = InternetConnect(lngINet, "Server", 0, _
"UN", "PW", 1, 0, 0)
blnrc = FtpGetFile(lngINetConn, "localfile", "FTPfile", 0, 0, 1, 0)
End Sub
Public Sub DownloadFile()
Dim lngINetConn
Dim lngINet
Dim blnrc
lngINet = InternetOpen("MyFTP Control", 1, vbNullString, vbNullString, 0)
lngINetConn = InternetConnect(lngINet, "Server", 0, _
"UN", "PW", 1, 0, 0)
blnrc = FtpPutFile(lngINetConn, "localfile", "FTPfile", 1, 0)
End Sub
-
Jun 13th, 2009, 01:16 AM
#2
Frenzied Member
Re: Mobile FTP
Where did you get those declarations from - they don't look right.
They look as though they may be eVB, as I am pretty sure the 'long' shoud be 'integer'
Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal
sAgent As String, ByVal lAccessType As Integer, ByVal sProxyName As String,
ByVal sProxyBypass As String, ByVal lFlags As Integer) As Integer
There is a sample here by Sergey Bogdanov which may help
Last edited by petevick; Jun 13th, 2009 at 01:33 AM.
-
Jun 13th, 2009, 11:22 PM
#3
Thread Starter
Junior Member
Re: Mobile FTP
I shoulda saw that one..Changing the Long to Integer got rid of that error. Now my InternetConnect is returning a 0. How can i find out what the exact problem for this was? I'm assuming there is some issue with connecting to the server.
I did also try that sample but i get a "Error: 12029" Not sure what that means
-
Jun 14th, 2009, 05:06 AM
#4
Frenzied Member
Re: Mobile FTP
From searching google - it would appear to be an 'activesync' problem - try it over GPRS/3G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|