ASPAlliance.com : The #1 Active Server Pages .NET Community The #1 ASP.NET Community
Search   Search

Subscribe   Subscribe

Powered by ORCSWeb Hosting


Site Stats


Powered By ASP.NET
 
Featured Sponsor

Featured Columnist


Featured Book
ASP.NET Tips, Tutorials, and Code
ASP.NET Tips, Tutorials, and Code

Find Prices
Read Review
Read Review
Sample Chapter
Sample Chapter


New! asp.netPRO

We publish our articles in the standard RSS format.

Powerful .NET Email Component

Code Sharing Software
WebClient.aspx.vb by Damian Manifold
  1 public class Webclient3
  2     Inherits System.Web.UI.Page
  3     protected WithEvents Literal1 as System.Web.UI.WebControls.Literal
  4 
  5     private Sub Page_Load(ByVal sender as System.objectByVal e as System.EventArgs) Handles MyBase.Load
  6         Dim wc as new System.Net.WebClient()
  7         Dim b as byte()
  8         Dim res as byte()
  9 
  10         'enncode the form data string into a byte array
  11         b = System.Text.Encoding.ASCII.GetBytes("text=test text&password=secret&checkbox=on&textarea=a longer text sentence&submit=submit")
  12 
  13         'set the content type of the data
  14         wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
  15 
  16         'scrapte the data
  17         res = wc.UploadData("http://authors.aspalliance.com/damianm/article/4/3/formreader.aspx", b)
  18 
  19         'convert the return page from a byte array to ascii and display
  20         Literal1.Text = System.Text.Encoding.ASCII.GetString(res)
  21     End Sub
  22 
  23 End class
WebClient.aspx.vbGenerated using CodeView
 Copyright © 2000-2003 ASPAlliance.com  Page Rendered at 11/21/2009 6:14:57 PM