unkwntech

SloppyLoggerScreenOutput

Apr 18th, 2014
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Windows.Forms;
  4.  
  5. namespace SlopScreens
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             try
  12.             {
  13.                 string output = "";
  14.  
  15.                 int i = 0;
  16.  
  17.                 float x = 0x0f, y = 0.0f;
  18.  
  19.                 foreach (var screen in Screen.AllScreens)
  20.                 {
  21.                     output += "[" + i.ToString() + "]\n";
  22.                     output += "x=" + screen.Bounds.Left + "\n";
  23.                     output += "y=" + screen.Bounds.Top + "\n";
  24.                     output += "w=" + screen.Bounds.Width + "\n";
  25.                     output += "h=" + screen.Bounds.Height + "\n";
  26.                     output += "x2=" + screen.Bounds.Right + "\n";
  27.                     output += "y2=" + screen.Bounds.Bottom + "\n";
  28.  
  29.                     x += screen.Bounds.Width;
  30.                     y += screen.Bounds.Height;
  31.  
  32.                     i++;
  33.                 }
  34.  
  35.                 output += "[Display]\n";
  36.  
  37.                 while (true)
  38.                 {
  39.                     x *= 0.9f;
  40.                     y *= 0.9f;
  41.  
  42.                     if(x <= 500 && y <= 200)
  43.                     {
  44.                         output += "CompleteH=" + y.ToString() + "\n";
  45.                         output += "CompleteW=" + x.ToString() + "\n";
  46.                         break;
  47.                     }
  48.                 }
  49.  
  50.  
  51.  
  52.                 using (StreamWriter sw = new StreamWriter("SloppyScreenSetup.ini"))
  53.                 {
  54.                     sw.Write(output);
  55.                 }
  56.  
  57.                 Console.Write("SUCCESS");
  58.  
  59.             }
  60.             catch (Exception)
  61.             {
  62.                 Console.Write("FAILED");
  63.             }
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment