JackOfDiamond5

WriteCodeOnFile(SteamBot)

Mar 24th, 2016
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | None | 0 0
  1.  public static void  WriteCodeOnFile()
  2.         {
  3.             string myLocation = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
  4.            
  5.             using (StreamWriter myCode = File.CreateText(myLocation + @"\Code.txt"))
  6.             {
  7.                 if (File.Exists(myLocation + @"\Code.txt")) //It can probably go without the condition
  8.                 {
  9.                     SteamGuardAccount myCall = new SteamGuardAccount();
  10.                     myCall = JsonConvert.DeserializeObject<SteamGuardAccount>(File.ReadAllText(Bot.authFile)); //I took that from the   GetMobileAuthCode() method, and tried to forge it a little
  11.                     myCode.WriteLine(myCall.GenerateSteamGuardCode());
  12.                     //myCode.WriteLine(Bot.GetMobileAuthCode()); - I kept this for trying different approaches
  13.  
  14.                     //I tried calling it in Main(), later in the Log.cs, also in Bot.cs, all was futile
  15.                     //It compiles just fine, but after the build, when I start the Bot, it won't give me the code, it doesn't have to be a text file, I just want it to give me the code, so that I can log in using the browser or the Steam client
  16.                 }
  17.             }            
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment