Home All Groups Group Topic Archive Search About

code for proxy script section

Author
22 Nov 2006 11:37 AM
deepak
Hi All,
    i  m develpoing a .net Window application which has
4 texboxes(tbxURLm for URL in URL Frame,tbxAddress for address in Proxy
server frame,tbxPort for port in proxy server frame,tbxProxyScript for proxy
script in proxy script frame) and a test button..The requirment is given below

STEP BY STEP GUIDE
1. Input the URL you want to test
2. Choose Proxy script/Proxy server with Address and Port Information/No proxy
3. Enter url to proxy script or info for proxy server in respective text box
4. Press test-button

---------------My Code is -------------------------------------------------
private void Calc_Time_For_URL()
{
try
   {                       
     //Time of Request
      DateTime dt1 = DateTime.Now;
     System.Net.HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create 
      (tbxURL.Text.ToString());

     //Proxy Server(Address and Port)
    if ((tbxAddress.Text.Length > 0) & (tbxPort.Text.Length >0))
   {
     myReq.Proxy = new
WebProxy(tbxAddress.Text,Convert.ToInt16(tbxPort.Text));
   }
  //Proxy Script
if (tbxProxyScript.Text.Length > 0)
{
NEED CODE FOR THIS SECTION
}
//GetResponse for this request.               
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse();
   //Time of Response  
DateTime dt2 = DateTime.Now;               
lblTimeTaken.Text = Convert.ToString(dt2.Subtract(dt1));
}
--------------------------------------------------------------------
in this code , i m unable to WRITE THE LOGIC FOR pXOSYSCRIPT, Can anybody
tell me how can i do this thorugh the code....This application is workign
fine for Url alone and Url with address and port but what should be code for
proxyscritp with url ?????????
...
i m working on window application as i need *.exe file rather than install
file ....


Thanks,
Deepak

AddThis Social Bookmark Button