Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using System.Text;
- using System.Threading.Tasks;
- using System.IO;
- namespace LauncherZold
- {
- class SendToServer
- {
- private bool proxy_setting = false;//not connected with proxy server
- ////this is your proxy username,password,ip
- //private string proxy_ip = "http://192.168.1.1";//your proxy server
- //private string port = "80"; //proxy password
- //private string username = "username"; //proxy username
- //private string password = "password"; //proxy password
- private string post_url_info = "http://localhost/dayz/engine.php";
- private string post_url_ban = "http://localhost/dayz/ban.php";
- private string post_url_ver = "http://localhost/dayz/ver.php";
- private string hash = "salt";
- public string sendTo(string nick,string hwid, string guid)
- {
- string _nick = nick;
- string _hwid = hwid;
- string _guid = guid;
- string result = "";
- string POST_DATA = "salt=" + hash + "&nick=" + _nick + "&hwid=" + _hwid + "&guid=" + _guid;
- string responseString = DataRequestToServer(POST_DATA, post_url_info);
- result = responseString;
- return result;
- }
- public string BanMe(string hwid, string nick, string guid)
- {
- string _nick = nick;
- string _hwid = hwid;
- string _guid = guid;
- string result = "";
- string POST_DATA = "salt=" + hash + "&nick=" + _nick + "&hwid=" + _hwid + "&guid=" + _guid;
- string responseString = DataRequestToServer(POST_DATA, post_url_ban);
- result = responseString;
- return result;
- }
- public string getVer()
- {
- string result = "";
- string POST_DATA = "salt=" + hash;
- string responseString = DataRequestToServer(POST_DATA, post_url_ver);
- result = responseString;
- return result;
- }
- public string sendCheats(string hwid, string req)
- {
- string _hwid = hwid;
- string _req = req;
- string result = "";
- string POST_DATA = "salt=" + hash + "&hwid=" + _hwid + "&req=" + _req;
- string responseString = DataRequestToServer(POST_DATA, post_url_ver);
- result = responseString;
- return result;
- }
- public string DataRequestToServer(string postData, string url)
- {
- try
- {
- HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create(url);
- //if (proxy_setting == true)
- //{
- // connectProxy(httpWReq);
- //}
- ASCIIEncoding encoding = new ASCIIEncoding();
- byte[] data = encoding.GetBytes(postData);
- httpWReq.Method = "POST";
- httpWReq.ContentType = "application/x-www-form-urlencoded";
- httpWReq.ContentLength = data.Length;
- using (Stream stream = httpWReq.GetRequestStream())
- {
- stream.Write(data, 0, data.Length);
- }
- HttpWebResponse response = (HttpWebResponse)httpWReq.GetResponse();
- string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
- return responseString;
- }
- catch (Exception e)
- {
- return e.Message;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement