473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

creating user using post method

I want to create user in register form with the help of a program of post method. I have written the following code for it:
Expand|Select|Wrap|Line Numbers
  1. string post_data="parul0";
  2. string uri="http://localhost:1161/Register.aspx";
  3. HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
  4. request.KeepAlive = false;
  5. request.ProtocolVersion = HttpVersion.Version10;
  6. request.Method = "POST";
  7. byte[] postBytes = Encoding.ASCII.GetBytes(post_data);
  8. request.ContentType = "application/x-www-form-urlencoded";
  9. request.ContentLength = postBytes.Length;
  10. Stream requestStream = request.GetRequestStream();
  11. requestStream.Write(postBytes, 0, postBytes.Length);
  12. requestStream.Close();
  13. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  14. Console.WriteLine(new StreamReader(response.GetResponseStream()).ReadToEnd());
  15. Console.WriteLine(response.StatusCode);
  16.  
New user is not getting created by this code.
In registration page, new user is created.
Sep 21 '11 #1
0 1092

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: eddie wang | last post by:
When I use the following to post my value, I got SQL like this: SELECT+A%2ECMPL%5FFIELD%5FID%2C+A%2ECMPL%5FFACILITY%. How to get the SELECT without those hex value. THanks. <FORM...
0
by: Ricardo Magalhaes | last post by:
Hi, I have an ASPX page and I need to call an ASP page sending parameters like Name, Adress, ie. using POST method. This next ASP page show payment informations.. If was from an ASP to...
4
by: davidfahy | last post by:
Hi all How can I transfer user to another server using POST. The problem is that Server.Transfer (preserves form data) works just in current server. Response.Redirect - uses GET method. However...
4
by: Velhari | last post by:
Hi all, We all know in GET method upto 2048 characters can be appended into URL. In the Same way what is the limit of sending data to server by using POST Method. Why asking this question...
2
by: sandeepk84 | last post by:
hi all... am trying to send data from one web page to another using post method.. the code is in C#.it's given in the click event of a command button. like destinationfilename.aspx?parameters how...
5
by: Bob Bedford | last post by:
Hi all, I've to accept a file that is sent using a POST method. The file will be sent using this URL: http://username:pass@www.mysite.com/upload.php How can I retrieve the username and...
2
by: ajmerasunny | last post by:
Hi, I have following task to implement: I have to pass username and password from first html page to second html page using POST Method and automatically submit the second html page on loading....
3
karthik baskar
by: karthik baskar | last post by:
I have a check box for which a user can check many values . I need to get the value of the check box in a variable in PHP to insert it into the database . Please someone help me ..
0
by: Debasis Jana | last post by:
i have a HTML form. An input box is there and hindi value gets submitted. Form action is GET. Now i am able to get the value using request.getParameter("fld_name"). As soon as i change the action...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.