Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inet in C# ? 1

Status
Not open for further replies.
Here is how I can get in C# the content of the thread where you put this question:
e.g.
Code:
int iThreadId=927761;
string strURL="[URL unfurl="true"]http://www.tek-tips.com";[/URL]
System.Net.WebRequest req = null;
try
{
   req = WebRequest.Create(strURL+"/viewthread.cfm?qid=" + iThreadId.ToString());
   req.Method = "GET";
   req.Timeout = 20000;
    //...
}
catch (Exception ex)
{
   string sErr = "Cannot connect to " + strURL +" : " + ex.Message;
   MessageBox.Show(sErr, strURL, MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
I would try the followings:
Code:
//..
req = WebRequest.Create("[URL unfurl="true"]http://200.100.100.100/econtrol.html?P1=t");[/URL]
req.Method = "POST";
//..
That is just to execute. If you want to process the response then use the System.Net.WebResponse with a StreamReader.
See -obislavu-
 
yfbf -
How about saying "thank you" with a star for obislavu?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I said many thanks for your working CHIPH and thank you for OBISLAVU.

;-)
 
Problem nothing to do

Please can you check it ?

Best Regrads

System.Net.WebRequest req = null;
System.Net.WebResponse rsp = null;

try
{
req = System.Net.WebRequest.Create("req.Method = "POST";
req.Timeout = 5000;
req = System.Net.WebRequest.Create("req.Method = "POST";
req.Timeout = 5000;
}
catch (Exception ex2)
{
string sErr = "Cannot connect to Internet. " + ex2.Message;
//DisplayBox(sErr, strURL, MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
 
I do not know how the econtrol.html manages the P8=t.
1. If you want to start the browser to execute that html file and in this case you need only one line:
System.Diagnostics.Process.Start("2. If you want to get that executed or/and also the response sent back to the user by the web server, then use the example I put in the previous post.
If your html file knows how to read and what to do with the P8=t variable/value passed then you must get back the right results.
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top