12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Windows.Forms;
- using System.DirectoryServices.AccountManagement;
- using System.Drawing;
- using System.IO;
- namespace FakeLogonScreen
- {
- static class Program
- {
-
-
-
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
-
- LogonScreen s = new LogonScreen();
-
- string imagePath = @"C:\Windows\Web\Screen\img100.jpg";
- if (File.Exists(imagePath))
- s.BackgroundImage = Image.FromFile(imagePath);
- else
- s.BackColor = Color.FromArgb(0, 90, 158);
-
- s.Username = Environment.UserName;
- s.Context = ContextType.Machine;
- try
- {
- UserPrincipal user = UserPrincipal.Current;
- s.Username = user.SamAccountName;
- s.DisplayName = user.DisplayName;
- s.Context = user.ContextType;
- }
- catch (Exception) { }
-
- Application.Run(s);
- }
- }
- }
|