Advertisement
Guest User

dauntless queue skip sourcecode

a guest
May 25th, 2018
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. //นักแงะ
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using System.Management;
  13. using System.Diagnostics;
  14. using System.IO;
  15. using Newtonsoft.Json;
  16.  
  17. namespace WindowsFormsApp1
  18. {
  19. public partial class Form1 : Form
  20. {
  21.  
  22. String path = string.Empty;
  23. public Form1()
  24. {
  25. InitializeComponent();
  26. }
  27.  
  28. private void Form1_Load(object sender, EventArgs e)
  29. {
  30. path = Properties.Settings.Default.path;
  31. }
  32.  
  33. public String LoadJson()
  34. {
  35. var token = "";
  36. Console.WriteLine(path);
  37. using (StreamReader r = new StreamReader(path+@"\Data\configuration.json"))
  38. {
  39. string json = r.ReadToEnd();
  40. dynamic array = JsonConvert.DeserializeObject(json);
  41. token = array.Values.userToken;
  42. }
  43. return token;
  44. }
  45.  
  46.  
  47. private void button1_Click(object sender, EventArgs e)
  48. {
  49.  
  50. var token = LoadJson();
  51. Console.WriteLine(token);
  52. var param = "-culture=en -authtoken=" + token;
  53. var t = path + @"\Data\Dauntless\Dauntless.exe";
  54. Console.WriteLine(t);
  55. Process.Start(t,param);
  56. }
  57.  
  58.  
  59. private string GetCommandLine(Process process)
  60. {
  61. var commandLine = new StringBuilder("");
  62.  
  63. using (var searcher = new ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + process.Id))
  64. {
  65. foreach (var @object in searcher.Get())
  66. {
  67. commandLine.Append(@object["CommandLine"]);
  68. }
  69. }
  70.  
  71. return commandLine.ToString();
  72. }
  73.  
  74. private void button2_Click(object sender, EventArgs e)
  75. {
  76. FolderBrowserDialog fbd = new FolderBrowserDialog();
  77. fbd.Description = "Custom Description";
  78.  
  79. if (fbd.ShowDialog() == DialogResult.OK)
  80. {
  81. path = fbd.SelectedPath;
  82. Properties.Settings.Default.path = path;
  83. Properties.Settings.Default.Save();
  84. }
  85. }
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement