Using system;
using system.text.regularexpressions;
using system.net;
using system.text;
using system.io;
using system.diagnostics;
public class program
{
public static void main()
{
string username = @"mylogin";
string password = @"mypassword";
string pattern = @"\d*: \w*: \w*: \w*";
regex regex = new regex(pattern);
webrequest request = webrequest.create("");
request.method = "post";
string postdata = "user=" + username + "& password=" + password + "& version=13";
byte[] bytearray = encoding.utf8.getbytes(postdata);
request.contenttype = "application/x-";
request.contentlength = bytearray.length;
stream datastream = request.getrequeststream();
datastream.write(bytearray, 0, bytearray.length);
datastream.close();
webresponse response = request.getresponse();
console.)response).statusdescription);
datastream = response.getresponsestream();
streamreader reader = new streamreader(datastream);
string responsefromserver = reader.readtoend();
string s = reader.readtoend();
if (responsefromserver.contains(" bad login"))
{
console.writeline("неправильный логин/пароль! ");
}
else if (responsefromserver.contains(" old version"))
{
console.writeline("обновите лаунчер! (скачайте новую версию с сайта clannr.org)");
}
else
{
string input = responsefromserver;
string[] split = input.split(': ');
string final = split[3];
processstartinfo mcstartinfo = new processstartinfo("javaw", "-xms1g -xmx1g -cp \"" + appdata + ".jar; " + appdata + ".jar; " + appdata + ".jar; " + appdata + ".jar \" -djava.library.path=\"" + appdata + "" net.minecraft.client.minecraft" + " " + username;
process.start(mcstartinfo);
this.close();
reader.close();
datastream.close();
response.close();
}
request.proxy = new webproxy();
}
}
пытаюсь сделать лаунчер майнкрафта но ругается по поводу appdata обьясните почему.