Web form data loading
Web form data loading
Web form data loading
Web form data loading
Web form data loading
Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading
Web form data loading Web form data loading
Web form data loading
Go Back  Xtreme Visual Basic Talk > > > Web form data loading


Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2005, 07:45 AM
--UnOmE-- --UnOmE-- is offline
Newcomer
 
Join Date: Feb 2005
Posts: 14
Default Web form data loading


Is there a way to transfer all the inputted field from my static vb form to a website that asks for this. eg. like firstname, lastname, phonenumber, email id?

thanx in advance...
__________________
Once I thought I was wrong... But I was Mistaken!!!
Reply With Quote
  #2  
Old 02-28-2005, 08:55 AM
Achilleterzo Achilleterzo is offline
Newcomer
 
Join Date: Feb 2005
Posts: 3
Default

Quote:
Originally Posted by --UnOmE--
Is there a way to transfer all the inputted field from my static vb form to a website that asks for this. eg. like firstname, lastname, phonenumber, email id?

thanx in advance...
i have problem with file upload in this code, but the text field is sent correctly..

yes, without file field this code work right:
Code:
Sub PostForm()
       Dim userid As String = "aaa"
       Dim password As String = "bbb"
       Dim PhoneNumber As String = "123"
       Dim FormText As String = "Test di messaggio"
       Dim encoding As New System.Text.ASCIIEncoding
       Dim postdata As New System.Text.StringBuilder


       With postdata
           .Append("PhoneNumber=")
           .Append(PhoneNumber)
           .Append("&FormText=")
           '.Append(System.Web.HttpUtility.UrlEncode(FormText))
           .Append(FormText)
       End With

       Dim data As Byte() = encoding.GetBytes(postdata.ToString)

       Dim request As System.Net.HttpWebRequest
       request = System.Net.HttpWebRequest.Create("http://server.com/")
       
       'use it if you need Auth
       'Dim networkCredential As New networkCredential(userid, password)

       With request
           'use it if you need Auth
           '.PreAuthenticate = True
           '.Credentials = networkCredential
           .Method = "POST"
           .ContentType = "multipart/form-data"
           .ContentLength = data.Length
       End With

       Dim sw As System.IO.Stream
       sw = request.GetRequestStream

       Try
           sw = request.GetRequestStream
           sw.Write(data, 0, data.Length)
           'sw.Write(File, 0, File.Lenght)
           sw.Close()
       Catch
           MsgBox(Err.Description & " SW error", MsgBoxStyle.Critical)
       End Try

       Dim response As System.Net.HttpWebResponse

       Try
           response = request.GetResponse
           Dim sr As New System.IO.StreamReader(response.GetResponseStream)
           Dim result As String = sr.ReadToEnd
           MsgBox(result, MsgBoxStyle.Information)
       Catch
           MsgBox(Err.Description, MsgBoxStyle.Critical)
       End Try
   End Sub
Reply With Quote
  #3  
Old 03-01-2005, 05:11 AM
--UnOmE-- --UnOmE-- is offline
Newcomer
 
Join Date: Feb 2005
Posts: 14
Default

Thanx very much i will try that out.
__________________
Once I thought I was wrong... But I was Mistaken!!!
Reply With Quote
  #4  
Old 03-01-2005, 07:41 AM
--UnOmE-- --UnOmE-- is offline
Newcomer
 
Join Date: Feb 2005
Posts: 14
Default

It says to me an error like remote server not reponds. PLs help
__________________
Once I thought I was wrong... But I was Mistaken!!!
Reply With Quote
  #5  
Old 03-01-2005, 07:54 AM
--UnOmE-- --UnOmE-- is offline
Newcomer
 
Join Date: Feb 2005
Posts: 14
Default

The error says that " Remote server returned an error: Method (405) not allowed"
__________________
Once I thought I was wrong... But I was Mistaken!!!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Web form data loading
Web form data loading
Web form data loading Web form data loading
Web form data loading
Web form data loading
Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading Web form data loading
Web form data loading
Web form data loading
 
Web form data loading
Web form data loading
 
-->