Click here to Skip to main content
16,004,806 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLock down a web site's allowable IP range to just one IP address [modified] Pin
jpang00119-Jun-10 15:43
jpang00119-Jun-10 15:43 
AnswerRe: Lock down a web site's allowable IP range to just one IP address Pin
DaveAuld19-Jun-10 23:46
professionalDaveAuld19-Jun-10 23:46 
GeneralRe: Lock down a web site's allowable IP range to just one IP address Pin
jpang00120-Jun-10 3:35
jpang00120-Jun-10 3:35 
GeneralRe: Lock down a web site's allowable IP range to just one IP address Pin
Dimitri Witkowski20-Jun-10 3:57
Dimitri Witkowski20-Jun-10 3:57 
AnswerRe: Lock down a web site's allowable IP range to just one IP address Pin
DaveAuld20-Jun-10 4:20
professionalDaveAuld20-Jun-10 4:20 
Question.asp Pin
AndyInUK19-Jun-10 12:19
AndyInUK19-Jun-10 12:19 
AnswerRe: .asp Pin
NeverHeardOfMe19-Jun-10 13:25
NeverHeardOfMe19-Jun-10 13:25 
QuestionProcessing webpage post (automated) Pin
David Hovey19-Jun-10 11:27
David Hovey19-Jun-10 11:27 
Hi All! I am trying to process several requests to a website, performing posts of data and processing page results. I'm finding it seems very inefficient, and actually it seems to take longer to process the request than compared to typing in manually.

Looking at the code below it appears there isn't a way to simplify or move initialization of objects to another method, rather than performing it each request is made (the requests are being made to the same website).

Here is my code below.

Thanks for all your help!

private string ProcessFormPOST(string strURL, string strFormData)
       {
           try
           {
               //string strViewstate = GetInitialViewState(strURL);
               //strViewstate = System.Web.HttpUtility.UrlEncode(strViewstate);
               //strFormData += "&__VIEWSTATE=" + strViewstate;

               byte[] buffer = Encoding.UTF8.GetBytes(strFormData);
               string proxy = null;

               System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strURL);

               req.Method = "POST";
               req.ContentType = "application/x-www-form-urlencoded";
               req.ContentLength = buffer.Length;
               req.Proxy = new System.Net.WebProxy(proxy, true); // ignore for local addresses
               req.CookieContainer = new System.Net.CookieContainer(); // enable cookies

               System.IO.Stream reqst = req.GetRequestStream(); // add form data to request stream
               reqst.Write(buffer, 0, buffer.Length);
               //reqst.Flush();
               reqst.Close();

               System.Net.HttpWebResponse res = (System.Net.HttpWebResponse)req.GetResponse(); // send request, get response

               System.IO.Stream resst = res.GetResponseStream(); // display HTTP response
               System.IO.StreamReader sr = new System.IO.StreamReader(resst);

               return sr.ReadToEnd();
           }
           catch (Exception ex)
           {
               throw ex;
           }
       }

QuestionGoogleMap as UserControl, using ModalPopup Pin
giantsover19-Jun-10 3:54
giantsover19-Jun-10 3:54 
AnswerRe: GoogleMap as UserControl, using ModalPopup Pin
DaveAuld19-Jun-10 6:40
professionalDaveAuld19-Jun-10 6:40 
GeneralRe: GoogleMap as UserControl, using ModalPopup Pin
giantsover19-Jun-10 8:24
giantsover19-Jun-10 8:24 
GeneralRe: GoogleMap as UserControl, using ModalPopup Pin
DaveAuld19-Jun-10 23:59
professionalDaveAuld19-Jun-10 23:59 
QuestionVisualisation of data table during debugging - function evaluation timeout Pin
ChrisFarrugia19-Jun-10 3:20
ChrisFarrugia19-Jun-10 3:20 
QuestionHyperlink Pin
farokhian19-Jun-10 2:26
farokhian19-Jun-10 2:26 
AnswerRe: Hyperlink Pin
Luc Pattyn19-Jun-10 2:58
sitebuilderLuc Pattyn19-Jun-10 2:58 
QuestionSession value in java script Pin
Amit Patel198519-Jun-10 0:52
Amit Patel198519-Jun-10 0:52 
AnswerRe: Session value in java script Pin
Sandeep Mewara19-Jun-10 1:07
mveSandeep Mewara19-Jun-10 1:07 
AnswerRe: Session value in java script Pin
PSK_19-Jun-10 5:38
PSK_19-Jun-10 5:38 
Questionfind the control id Pin
rummer18-Jun-10 20:33
rummer18-Jun-10 20:33 
AnswerRe: find the control id Pin
Sandeep Mewara19-Jun-10 1:05
mveSandeep Mewara19-Jun-10 1:05 
QuestionPaypal Pin
Gjm18-Jun-10 20:07
Gjm18-Jun-10 20:07 
AnswerRe: Paypal Pin
Sandeep Mewara19-Jun-10 1:00
mveSandeep Mewara19-Jun-10 1:00 
Questionhow to check the procedure is already exists in database Pin
developerit18-Jun-10 19:12
developerit18-Jun-10 19:12 
AnswerRe: how to check the procedure is already exists in database Pin
Blue_Boy18-Jun-10 23:29
Blue_Boy18-Jun-10 23:29 
QuestionHow to enforce Http Response Code in Routing ? Pin
Nadia Monalisa18-Jun-10 16:04
Nadia Monalisa18-Jun-10 16:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.