Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Drawing;
- using System.Linq;
- using System.Windows.Forms;
- namespace ScreenRes
- {
- class Program
- {
- private static string GetWallpaperFilename(Rectangle res, string domain)
- {
- int[] AcceptedWidth = { 1024, 1280, 1366, 1440, 1920 };
- int[] AcceptedHeight = { 768, 1024, 900, 1080, 1200 };
- if (AcceptedHeight.Contains(res.Height) && AcceptedWidth.Contains(res.Width))
- {
- //Si on possède un fond d'écran à la résolution exacte de l'écran...
- return String.Format("{0}_{1}x{2}.JPG", domain, res.Width, res.Height);
- }
- else
- {
- //Sinon, on fournit un fond d'écran standard
- return "AD_defaultRes.JPG";
- }
- }
- static void Main(string[] args)
- {
- if (Environment.UserDomainName != "NEPTUNE")
- {
- Console.WriteLine("Pas le bon domaine");
- Console.ReadLine();
- }
- else
- {
- Rectangle resolution = Screen.PrimaryScreen.Bounds;
- Console.WriteLine(GetWallpaperFilename(resolution, Environment.UserDomainName));
- Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement