Private string GetModel (string strurl)
{
String strret = NULL;
Try
{
Httpwebrequest request = (httpwebrequest) webrequest. Create (strurl );
Request. Timeout = 2000;
Httpwebresponse response = (httpwebresponse) request. getresponse ();
System. Io. Stream resstream = response. getresponsestream ();
Encoding encode = system. Text. encoding. default;
Streamreader readstream = new streamreader (resstream, encode );
Char [] READ = new char [256];
Int COUNT = readstream. Read (read, 0,256 );
While (count> 0)
{
String STR = new string (read, 0, count );
Strret = strret + STR;
Count = readstream. Read (read, 0,256 );
}
Resstream. Close ();
}
Catch (exception E)
{
Strret = "";
}
Return strret;
}
Public static string postmodel (string strurl, string strparm)
{
Encoding encode = system. Text. encoding. default;
Byte [] arrb = encode. getbytes (strparm );
String strbaseurl = NULL;
Httpwebrequest myreq = (httpwebrequest) webrequest. Create (strurl );
Myreq. method = "Post ";
Myreq. contenttype = "application/X-WWW-form-urlencoded ";
Myreq. contentlength = arrb. length;
Stream outstream = myreq. getrequeststream ();
Outstream. Write (arrb, 0, arrb. Length );
Outstream. Close ();
Webresponse myresp = NULL;
Try
{
// Receives the HTTP Response
Myresp = myreq. getresponse ();
}
Catch (exception E)
{
Int II = 0;
}
Stream receivestream = myresp. getresponsestream ();
Streamreader readstream = new streamreader (receivestream, encode );
Char [] READ = new char [256];
Int COUNT = readstream. Read (read, 0,256 );
String STR = NULL;
While (count> 0)
{
STR + = new string (read, 0, count );
Count = readstream. Read (read, 0,256 );
}
Readstream. Close ();
Myresp. Close ();
Return STR;
}