Public String geturldate (string URL, string method, string content)
{< br> string outstring = "";
try
{< br> system. net. httpwebrequest myrequest = (system. net. httpwebrequest) system. net. httpwebrequest. create (URL);
myrequest. method = method;
myrequest. keepalive = false;
myrequest. contenttype = "application/X-WWW-form-urlencoded";
system. text. asciiencoding encoding = new system. text. asciiencoding ();
string postdata = content;
byte [] DATA = encoding. getbytes (postdata);
myrequest. contentlength = data. length;
system. io. stream newstream = myrequest. getrequeststream ();
newstream. write (data, 0, Data. length);
newstream. close ();
Using (system. net. httpwebresponse myresponse = (system. net. httpwebresponse) myrequest. getresponse ())
{
System. Io. streamreader sr = new system. Io. streamreader (myresponse. getresponsestream (), system. Text. encoding. utf8 );
Outstring = Sr. readtoend ();
}
}
Catch (exception ex)
{
Iexceptionpublisher publisher = new exceptionpublisher ();
Publisher. Publish (ex, null, null );
Outstring = "";
}
Return outstring;
}