|
-
Jun 16th, 2006, 05:07 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] send a text file to server
hi, i have an pda application that generate some text files.
how can i send them to the server???
thanks
Last edited by shahid; Jun 28th, 2006 at 03:59 AM.
Reason: resolved
-
Jun 16th, 2006, 05:43 AM
#2
Frenzied Member
Re: send a text file to server
FTP, Web Service, custom server, RAPI
You have a big choice
Pete
-
Jun 16th, 2006, 06:05 AM
#3
Thread Starter
Fanatic Member
Re: send a text file to server
can u plz give me the codes for web services
-
Jun 16th, 2006, 07:03 AM
#4
Thread Starter
Fanatic Member
Re: send a text file to server
-
Jun 16th, 2006, 08:21 AM
#5
Fanatic Member
Re: send a text file to server
using the Winint.dll you can use FTP
find more about it here
http://www.teksoftco.com/articles/ftp%20client.htm
RAPI you will need create a desktop application that will pull the file across over activesync
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Jun 16th, 2006, 08:26 AM
#6
Thread Starter
Fanatic Member
Re: send a text file to server
thx m8..but i didnt get any thing by it.
is there any way to sending data from pda to server ...by vb.net...using http protocols....
-
Jun 16th, 2006, 08:32 AM
#7
Fanatic Member
Re: send a text file to server
from doing a search on google i found this
http://forums.asp.net/thread/1082923.aspx
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Jun 16th, 2006, 08:39 AM
#8
Thread Starter
Fanatic Member
Re: send a text file to server
it's nice but work with asp.net pages... i am using vb.net on PDA ...
not good for me.
-
Jun 16th, 2006, 08:57 AM
#9
Thread Starter
Fanatic Member
Re: send a text file to server
if i have two pages on server...1 for file selection 2 for save the file...as we use in asp/asp.net to upload files on server thru http protocol....
so can i call the 2nd file thru vb.net...via httprequest object...but how i fill the data (if i run it from server i shud use file1 for file selection...)
hope i get a hint/solution.
thaks
-
Jun 16th, 2006, 07:29 PM
#10
PowerPoster
Re: send a text file to server
you are best to transmit the data via network stream and then the server application to save the data recieved to text file
-
Jun 17th, 2006, 04:35 AM
#11
Thread Starter
Fanatic Member
Re: send a text file to server
is there any solutions to do it??? using XML SOAP etc etc..????
-
Jun 17th, 2006, 06:48 AM
#12
PowerPoster
Re: send a text file to server
I've just given you a solution.
-
Jun 19th, 2006, 03:32 AM
#13
Fanatic Member
Re: send a text file to server
 Originally Posted by shahid
is there any solutions to do it??? using XML SOAP etc etc..????
If you use webservices you are using xml and soap
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Jun 19th, 2006, 05:33 AM
#14
Thread Starter
Fanatic Member
Re: send a text file to server
i can not use application on the server...
how i use web service for this purpose?
-
Jun 19th, 2006, 05:40 AM
#15
Fanatic Member
Re: send a text file to server
 Originally Posted by shahid
i can not use application on the server...
what cant you use on the server?
 Originally Posted by shahid
how i use web service for this purpose?
i've posted a link in earlier post
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Jun 28th, 2006, 03:35 AM
#16
Thread Starter
Fanatic Member
Re: send a text file to server
the follwoing code send data to the server thru querystring...where the asp file on server will get it and save a text file.
(if you are behind the proxy then ON the proxy codes)
also the lstresult for showing the result.
hope it's help
VB Code:
Dim b As String = "name_" & Now.Date & ".txt"
b = Replace(b, "/", "-")
Dim url As String = "http://www.myurl.net/file.asp?a=" & strData & "&b=" & b
Try
' If Not "".Equals(txtProxy.Text) Then
'Dim proxyObject As New WebProxy(proxy, 80)
' Disable proxy use when the host is local.
'proxyObject.BypassProxyOnLocal = True
' HTTP requests use this proxy information.
'GlobalProxySelection.Select = proxyObject
'End If
Dim req As WebRequest = WebRequest.Create(url)
Dim result As WebResponse = req.GetResponse()
Dim ReceiveStream As Stream = result.GetResponseStream()
Dim encode As Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim sr As New StreamReader(ReceiveStream, encode)
' Read the stream into arrays of 30 characters
' to add as items in the list box. Repeat until
'' buffer is read.
Dim read(29) As [Char]
Dim count As Integer = sr.Read(read, 0, 30)
While count > 0
Dim astr As New String(read, 0, count)
lstresults.Text = lstresults.Text & astr
count = sr.Read(read, 0, 30)
If astr = "done" Then
btnOK.Enabled = True
btnRetry.Enabled = False
End If
End While
'Return True
Catch ex As WebException
Dim message As String = ex.Message
Dim response As HttpWebResponse = CType(ex.Response, HttpWebResponse)
If Nothing Is response Then
Else
message = response.StatusDescription
response.Close()
End If
btnRetry.Enabled = True
btnOK.Enabled = False
'Return False
lstresults.Text = lstresults.Text & vbCrLf & message
Catch ex As Exception
'Return False
lstresults.Text = lstresults.Text & vbCrLf & ex.Message
End Try
'=============================end of http url==================================
-
Jun 28th, 2006, 03:38 AM
#17
Thread Starter
Fanatic Member
Re: send a text file to server
the following codes send the data to the server thru query string..where the server page get it and save as a text file.
unblock the proxy if u behind the proxy server.
put a lstresult (listbox) before run it.
hope it's help
VB Code:
Dim b As String = "auditor_" & Now.Date & ".txt"
b = Replace(b, "/", "-")
Dim url As String = "http://myserver.com/file.asp?a=" & strData & "&b=" & b
Try
' If Not "".Equals(txtProxy.Text) Then
'Dim proxyObject As New WebProxy(proxy, 80)
' Disable proxy use when the host is local.
'proxyObject.BypassProxyOnLocal = True
' HTTP requests use this proxy information.
'GlobalProxySelection.Select = proxyObject
'End If
Dim req As WebRequest = WebRequest.Create(url)
Dim result As WebResponse = req.GetResponse()
Dim ReceiveStream As Stream = result.GetResponseStream()
Dim encode As Encoding = System.Text.Encoding.GetEncoding("utf-8")
Dim sr As New StreamReader(ReceiveStream, encode)
' Read the stream into arrays of 30 characters
' to add as items in the list box. Repeat until
'' buffer is read.
Dim read(29) As [Char]
Dim count As Integer = sr.Read(read, 0, 30)
While count > 0
Dim astr As New String(read, 0, count)
lstresults.Text = lstresults.Text & astr
count = sr.Read(read, 0, 30)
If astr = "done" Then
btnOK.Enabled = True
btnRetry.Enabled = False
End If
End While
'Return True
Catch ex As WebException
Dim message As String = ex.Message
Dim response As HttpWebResponse = CType(ex.Response, HttpWebResponse)
If Nothing Is response Then
Else
message = response.StatusDescription
response.Close()
End If
btnRetry.Enabled = True
btnOK.Enabled = False
'Return False
lstresults.Text = lstresults.Text & vbCrLf & message
Catch ex As Exception
'Return False
lstresults.Text = lstresults.Text & vbCrLf & ex.Message
End Try
'=============================end of http url==================================
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
|