Permalänk
Medlem

Hur kompilerar man c#?

Hej jag undrar hur man compilar ett c# script?

Visa signatur

NODE 304 - I5 3570K - GTX 680 - 240GB SSD - INTEGRA R2 650W

Permalänk
Medlem
Visa signatur

Lian Li PC-V2120B | ASUS X79-Deluxe | Intel 4930K + EK 360 | Corsair 4x8GB 1866MHz VENGEANCE LP | EVGA Geforce GTX 1080 Ti FTW3 SLI | Corsair AX1200i | Intel 530 240GB + Samsung 860 EVO 1TB + några TB blandad mekanik | Dell U2711 | Synology DS 411j

Permalänk
Medlem
Skrivet av mr_sQuinty:

Exakt detta. Om du är på Windows skulle jag rekommendera Microsoft Visual C# Express.

Permalänk

F5 eller nåt F6 kanske

Permalänk
Medlem

när jag gör nytt projekt i visual c# 2010 express hur vet jag vad jag ska välja då?

ska compila denna sourcen

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Runtime.InteropServices; using System.IO; using System.Reflection; using System.Security.Cryptography; namespace LoLAutoLogin { public partial class Form1 : Form { #region Native Methods & Variables [DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); [DllImport("user32.dll")] public static extern int SendMessage(int hWnd, uint Msg, long wParam, long lParam); [DllImportAttribute("User32.dll")] private static extern int FindWindow(String ClassName, String WindowName); [DllImport("User32.dll")] private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow); [DllImport("User32.dll")] private static extern bool SetForegroundWindow(IntPtr hWnd); private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04; private const int WS_SHOWNORMAL = 1; #endregion private string Password; int desksHeights, desksWidths, X, X2, Y, Y2; int TimeOutCounter; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { desksHeights = Screen.PrimaryScreen.Bounds.Height; desksWidths = Screen.PrimaryScreen.Bounds.Width; X = desksWidths - (desksWidths / 2); X = X + (X / 3); Y = desksHeights - (desksHeights / 2); Y = Y + (Y / 2); CheckScreens.Start(); EndProcess("LoLLauncher"); CheckSettings("settings.txt"); } private void Save_Click(object sender, EventArgs e) { if (tbPass.Text == tbPassCheck.Text) { StreamWriter SW; SW = File.CreateText("settings.txt"); SW.Close(); string Encrypted = EncryptString(tbPass.Text, "secret"); AppendToFile(Encrypted, "settings.txt"); tbPass.Text = ""; string path = Environment.CurrentDirectory + @/settings.txt; File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden); Application.Restart(); } else { MessageBox.Show("The passwords you entered did not match!"); } } private void CheckScreens_Tick(object sender, EventArgs e) { int hWnd1 = FindWindow("RADSWindowClass", "PVP.net Patcher"); if (hWnd1 > 0) { foreach (Process p in System.Diagnostics.Process.GetProcessesByName("LoLLauncher")) { try { SetForegroundWindow(p.MainWindowHandle); ShowWindowAsync(p.MainWindowHandle, WS_SHOWNORMAL); } catch { } } Cursor.Position = new Point(X, Y); mouse_event(MOUSEEVENTF_LEFTDOWN, Cursor.Position.X, Cursor.Position.Y, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, Cursor.Position.X, Cursor.Position.Y, 0, 0); } int hWnd2 = FindWindow("ApolloRuntimeContentWindow", "PVP.net Client"); if (hWnd2 > 0) { foreach (Process p in System.Diagnostics.Process.GetProcessesByName("LolClient")) { try { SetForegroundWindow(p.MainWindowHandle); ShowWindowAsync(p.MainWindowHandle, WS_SHOWNORMAL); } catch { } } CheckScreens.Stop(); SetPassword(); } } private void SetPassword() { if (File.Exists("settings.txt")) { StreamReader SR; string S; SR = File.OpenText("settings.txt"); S = SR.ReadLine(); while (S != null) { Password = S; S = SR.ReadLine(); } SR.Close(); if (Password != null) { string Decrypted = DecryptString(Password, "secret"); System.Threading.Thread.Sleep(2000); SendKeys.SendWait(Decrypted); SendKeys.SendWait("{ENTER}"); System.Threading.Thread.Sleep(2000); Application.Exit(); } else { EndProcess("LolClient"); MessageBox.Show("Password not set correctly"); File.Delete("settings.txt"); Application.Exit(); } } } private void EndProcess(string Name) { foreach (Process p in System.Diagnostics.Process.GetProcessesByName(Name)) { try { p.Kill(); p.WaitForExit(); } catch { } } } private void CheckSettings(string settings) { if (File.Exists(settings)) { try { Process LoLLauncher = Process.Start("lol.launcher.exe", ""); } catch { MessageBox.Show("This executable has to be in the root of your League of Legends folder."); Application.Exit(); } } else { Panel.Visible = true; this.TransparencyKey = Color.YellowGreen; this.BackColor = Color.LightGray; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.BackgroundImage = new Bitmap(Properties.Resources.bg); } } private void AppendToFile(string Password, string settings) { try { StreamWriter SW; SW = File.AppendText(settings); SW.WriteLine(Password); SW.Close(); } catch { MessageBox.Show("Something went wrong while writing the password to the settings textfile.\r\n" + "You could set this manually by creating a textfile named 'settings'.\r\n" + "Put your password in the first line of the textfile."); } } public static string EncryptString(string Message, string Passphrase) { byte[] Results; System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding(); // Step 1. We hash the passphrase using MD5 // We use the MD5 hash generator as the result is a 128 bit byte array // which is a valid length for the TripleDES encoder we use below MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider(); byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase)); // Step 2. Create a new TripleDESCryptoServiceProvider object TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider(); // Step 3. Setup the encoder TDESAlgorithm.Key = TDESKey; TDESAlgorithm.Mode = CipherMode.ECB; TDESAlgorithm.Padding = PaddingMode.PKCS7; // Step 4. Convert the input string to a byte[] byte[] DataToEncrypt = UTF8.GetBytes(Message); // Step 5. Attempt to encrypt the string try { ICryptoTransform Encryptor = TDESAlgorithm.CreateEncryptor(); Results = Encryptor.TransformFinalBlock(DataToEncrypt, 0, DataToEncrypt.Length); } finally { // Clear the TripleDes and Hashprovider services of any sensitive information TDESAlgorithm.Clear(); HashProvider.Clear(); } // Step 6. Return the encrypted string as a base64 encoded string return Convert.ToBase64String(Results); } public static string DecryptString(string Message, string Passphrase) { byte[] Results; System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding(); // Step 1. We hash the passphrase using MD5 // We use the MD5 hash generator as the result is a 128 bit byte array // which is a valid length for the TripleDES encoder we use below MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider(); byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase)); // Step 2. Create a new TripleDESCryptoServiceProvider object TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider(); // Step 3. Setup the decoder TDESAlgorithm.Key = TDESKey; TDESAlgorithm.Mode = CipherMode.ECB; TDESAlgorithm.Padding = PaddingMode.PKCS7; // Step 4. Convert the input string to a byte[] byte[] DataToDecrypt = Convert.FromBase64String(Message); // Step 5. Attempt to decrypt the string try { ICryptoTransform Decryptor = TDESAlgorithm.CreateDecryptor(); Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length); } finally { // Clear the TripleDes and Hashprovider services of any sensitive information TDESAlgorithm.Clear(); HashProvider.Clear(); } // Step 6. Return the decrypted string in UTF8 format return UTF8.GetString(Results); } private void TimeOut_Tick(object sender, EventArgs e) { TimeOutCounter++; if (TimeOutCounter >= 20) { Application.Exit(); } } } }

Dold text
Visa signatur

NODE 304 - I5 3570K - GTX 680 - 240GB SSD - INTEGRA R2 650W

Permalänk
Skrivet av Höbalen:

när jag gör nytt projekt i visual c# 2010 express hur vet jag vad jag ska välja då?

http://i.imgur.com/yKsm0.png

ska compila denna sourcen

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Runtime.InteropServices; using System.IO; using System.Reflection; using System.Security.Cryptography; namespace LoLAutoLogin { public partial class Form1 : Form { #region Native Methods & Variables [DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo); [DllImport("user32.dll")] public static extern int SendMessage(int hWnd, uint Msg, long wParam, long lParam); [DllImportAttribute("User32.dll")] private static extern int FindWindow(String ClassName, String WindowName); [DllImport("User32.dll")] private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow); [DllImport("User32.dll")] private static extern bool SetForegroundWindow(IntPtr hWnd); private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04; private const int WS_SHOWNORMAL = 1; #endregion private string Password; int desksHeights, desksWidths, X, X2, Y, Y2; int TimeOutCounter; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { desksHeights = Screen.PrimaryScreen.Bounds.Height; desksWidths = Screen.PrimaryScreen.Bounds.Width; X = desksWidths - (desksWidths / 2); X = X + (X / 3); Y = desksHeights - (desksHeights / 2); Y = Y + (Y / 2); CheckScreens.Start(); EndProcess("LoLLauncher"); CheckSettings("settings.txt"); } private void Save_Click(object sender, EventArgs e) { if (tbPass.Text == tbPassCheck.Text) { StreamWriter SW; SW = File.CreateText("settings.txt"); SW.Close(); string Encrypted = EncryptString(tbPass.Text, "secret"); AppendToFile(Encrypted, "settings.txt"); tbPass.Text = ""; string path = Environment.CurrentDirectory + @/settings.txt; File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden); Application.Restart(); } else { MessageBox.Show("The passwords you entered did not match!"); } } private void CheckScreens_Tick(object sender, EventArgs e) { int hWnd1 = FindWindow("RADSWindowClass", "PVP.net Patcher"); if (hWnd1 > 0) { foreach (Process p in System.Diagnostics.Process.GetProcessesByName("LoLLauncher")) { try { SetForegroundWindow(p.MainWindowHandle); ShowWindowAsync(p.MainWindowHandle, WS_SHOWNORMAL); } catch { } } Cursor.Position = new Point(X, Y); mouse_event(MOUSEEVENTF_LEFTDOWN, Cursor.Position.X, Cursor.Position.Y, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, Cursor.Position.X, Cursor.Position.Y, 0, 0); } int hWnd2 = FindWindow("ApolloRuntimeContentWindow", "PVP.net Client"); if (hWnd2 > 0) { foreach (Process p in System.Diagnostics.Process.GetProcessesByName("LolClient")) { try { SetForegroundWindow(p.MainWindowHandle); ShowWindowAsync(p.MainWindowHandle, WS_SHOWNORMAL); } catch { } } CheckScreens.Stop(); SetPassword(); } } private void SetPassword() { if (File.Exists("settings.txt")) { StreamReader SR; string S; SR = File.OpenText("settings.txt"); S = SR.ReadLine(); while (S != null) { Password = S; S = SR.ReadLine(); } SR.Close(); if (Password != null) { string Decrypted = DecryptString(Password, "secret"); System.Threading.Thread.Sleep(2000); SendKeys.SendWait(Decrypted); SendKeys.SendWait("{ENTER}"); System.Threading.Thread.Sleep(2000); Application.Exit(); } else { EndProcess("LolClient"); MessageBox.Show("Password not set correctly"); File.Delete("settings.txt"); Application.Exit(); } } } private void EndProcess(string Name) { foreach (Process p in System.Diagnostics.Process.GetProcessesByName(Name)) { try { p.Kill(); p.WaitForExit(); } catch { } } } private void CheckSettings(string settings) { if (File.Exists(settings)) { try { Process LoLLauncher = Process.Start("lol.launcher.exe", ""); } catch { MessageBox.Show("This executable has to be in the root of your League of Legends folder."); Application.Exit(); } } else { Panel.Visible = true; this.TransparencyKey = Color.YellowGreen; this.BackColor = Color.LightGray; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.BackgroundImage = new Bitmap(Properties.Resources.bg); } } private void AppendToFile(string Password, string settings) { try { StreamWriter SW; SW = File.AppendText(settings); SW.WriteLine(Password); SW.Close(); } catch { MessageBox.Show("Something went wrong while writing the password to the settings textfile.\r\n" + "You could set this manually by creating a textfile named 'settings'.\r\n" + "Put your password in the first line of the textfile."); } } public static string EncryptString(string Message, string Passphrase) { byte[] Results; System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding(); // Step 1. We hash the passphrase using MD5 // We use the MD5 hash generator as the result is a 128 bit byte array // which is a valid length for the TripleDES encoder we use below MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider(); byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase)); // Step 2. Create a new TripleDESCryptoServiceProvider object TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider(); // Step 3. Setup the encoder TDESAlgorithm.Key = TDESKey; TDESAlgorithm.Mode = CipherMode.ECB; TDESAlgorithm.Padding = PaddingMode.PKCS7; // Step 4. Convert the input string to a byte[] byte[] DataToEncrypt = UTF8.GetBytes(Message); // Step 5. Attempt to encrypt the string try { ICryptoTransform Encryptor = TDESAlgorithm.CreateEncryptor(); Results = Encryptor.TransformFinalBlock(DataToEncrypt, 0, DataToEncrypt.Length); } finally { // Clear the TripleDes and Hashprovider services of any sensitive information TDESAlgorithm.Clear(); HashProvider.Clear(); } // Step 6. Return the encrypted string as a base64 encoded string return Convert.ToBase64String(Results); } public static string DecryptString(string Message, string Passphrase) { byte[] Results; System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding(); // Step 1. We hash the passphrase using MD5 // We use the MD5 hash generator as the result is a 128 bit byte array // which is a valid length for the TripleDES encoder we use below MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider(); byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase)); // Step 2. Create a new TripleDESCryptoServiceProvider object TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider(); // Step 3. Setup the decoder TDESAlgorithm.Key = TDESKey; TDESAlgorithm.Mode = CipherMode.ECB; TDESAlgorithm.Padding = PaddingMode.PKCS7; // Step 4. Convert the input string to a byte[] byte[] DataToDecrypt = Convert.FromBase64String(Message); // Step 5. Attempt to decrypt the string try { ICryptoTransform Decryptor = TDESAlgorithm.CreateDecryptor(); Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length); } finally { // Clear the TripleDes and Hashprovider services of any sensitive information TDESAlgorithm.Clear(); HashProvider.Clear(); } // Step 6. Return the decrypted string in UTF8 format return UTF8.GetString(Results); } private void TimeOut_Tick(object sender, EventArgs e) { TimeOutCounter++; if (TimeOutCounter >= 20) { Application.Exit(); } } } }

Dold text

Testa Windows Forms Application.

Visa signatur
Permalänk
Medlem

LoL autologin?

En fråga.. är du så lat så du inte orkar skriva ditt lösenord?

Visa signatur

| Ryzen 1700 @ 4.0 ghz | Asus PRIME X370-PRO | 32 GB Corsair Vengeance LP 3000 mHz | Gigabyte GTX 770 2-way SLI | BenQ XL2410T, 5x AOC e2460SDA | Fractal design R5 | https://i.imgur.com/rjO3bLw.jpg

Software developer

Permalänk
Medlem
Skrivet av makkesk8:

LoL autologin?

En fråga.. är du så lat så du inte orkar skriva ditt lösenord?

Ja.

Visa signatur

NODE 304 - I5 3570K - GTX 680 - 240GB SSD - INTEGRA R2 650W

Permalänk
Medlem
Skrivet av makkesk8:

LoL autologin?

En fråga.. är du så lat så du inte orkar skriva ditt lösenord?

Han må vara lat, men jag ser inget fel i det. Varför inte göra det så lätt för sig som möjligt?

Permalänk
Medlem
Skrivet av makkesk8:

LoL autologin?

En fråga.. är du så lat så du inte orkar skriva ditt lösenord?

Lathet och lathet. Han kanske ville testa sina kunskaper och ville göra en autologin. Ser inte heller några fel med det. Keep it up!

Visa signatur

citera gärna så jag hittar tillbaka!

Permalänk
Skrivet av Gardart:

Lathet och lathet. Han kanske ville testa sina kunskaper och ville göra en autologin. Ser inte heller några fel med det. Keep it up!

Om man skriver ett sådant program så måste man ju veta hur man kompilerar det?

Visa signatur
Permalänk
Medlem
Skrivet av Kebabhyvlarn:

Om man skriver ett sådant program så måste man ju veta hur man kompilerar det?

haha jo det har du rätt i
Men ändå, tycker det inte är lathet!

Visa signatur

citera gärna så jag hittar tillbaka!

Permalänk
Skrivet av Gardart:

Lathet och lathet. Han kanske ville testa sina kunskaper och ville göra en autologin. Ser inte heller några fel med det. Keep it up!

Testa sina kunskaper? Klarar han av att skriva den där koden borde ha kunna kompilera också...

Visa signatur

Pappy :"Backup: Skyddar mot datafel när du på fyllan raderar 200GB pr0n och laddar hem två säsonger teletubbies istället."
Jocke1100 :"Det är väl en mekanisk kylavledning... Typ analog kylpasta..."

Permalänk
Medlem

Kommer inte funka att bara klistra in koden då det ligger knappevents som inte har några knappar till dem. Har man inga grundläggande kunskaper är det svårt att fixa. Men det är ju hur lätt som hellst i windows att ställa in att logga in på sitt konto direkt? :S

Permalänk
Medlem

andvände mig av "Autohotkeys" ist med denna koden...

Process, Close, LoLLauncher.exe Process, Close, LoLClient.exe Process, Close, rads_user_kernel.exe sleep 500 Run, "lol.launcher.exe", , NewPID sleep 1000 passw := "lösenord" Click, 707, 545 Sleep 2600 Click, 1004, 383 sleep 500 Click, 445, 742 Send {Enter} Sleep 50 Send % passw Sleep 50 Send {Enter}

Visa signatur

NODE 304 - I5 3570K - GTX 680 - 240GB SSD - INTEGRA R2 650W