ASP.NET POST Submitted Data!

xiaoxiao2021-03-06  70

String URL = "URL"; httpwebrequest req = (httpwebRequest) WebRequest.create (URL); string s = "data to be submitted"; byte [] requestBytes = system.text.Encoding.ascii.getbytes (loginInfo); Req. Method = "POST"; req.ContentType = "application / x-www-form-urlencoded"; req.ContentLength = requestBytes.Length; Stream requestStream = req.GetRequestStream (); requestStream.Write (requestBytes, 0, requestBytes.Length RequestStream.Close ();

HttpWebResponse res = (HttpWebResponse) req.GetResponse (); StreamReader sr = new StreamReader (res.GetResponseStream (), System.Text.Encoding.Default); string backstr = sr.ReadToEnd (); Response.Write (line); sr . Close (); res.

转载请注明原文地址:https://www.9cbs.com/read-91687.html

New Post(0)