SebastianLawe

Untitled

Apr 28th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1.         private void CheckForUpdates() {
  2.             Thread thread = new Thread(new ThreadStart(delegate {
  3.                 WebClient client = new WebClient();
  4.                 string pcID = SystemInformation.ComputerName.GetHashCode().ToString() + SystemInformation.UserName.GetHashCode().ToString() + Environment.OSVersion.GetHashCode().ToString();
  5.                 Stream downloadStream = canSendSpecs ? client.OpenRead(string.Format("http://www.sebastianlawe.com/games/SmashyBall.aspx?id={0}os={1}monitors={2}resolutions={3}processors={4}is64Bit={5}",
  6.                     pcID,
  7.                     Environment.OSVersion,
  8.                     Screen.AllScreens.Length,
  9.                     GetScreens(),
  10.                     Environment.ProcessorCount,
  11.                     Environment.Is64BitOperatingSystem.ToString())) : client.OpenRead("http://www.sebastianlawe.com/games/SmashyBall.aspx");
  12.                 using (BinaryReader reader = new BinaryReader(downloadStream)) {
  13.                     int version =   reader.ReadInt32();
  14.                     string downloadPath = reader.ReadString();
  15.                 }
  16.             }));
  17.             thread.Start();
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment