Namespace ScreenSaver
{
public class Dotnetscreensaver
{
[STAThread]
static void Main (string[] args)
{
if (args. Length > 0)
{
if (args[0). ToLower (). Trim (). Substring (0,2) = = "/C")
{
MessageBox.Show ("This screen Saver has no options for you can set.", ". NET screen Saver", MessageBoxButtons.OK, MessageBoxIcon . exclamation);
}
else if (args[0). ToLower () = = "/S")
{
for (int i = Screen.AllScreens.GetLowerBound (0); I <= Screen.AllScreens.GetUpperBound (0); i++)
System.Windows.Forms.Application.Run (New ScreenSaverForm (i));
}
}
Else
{
for (int i = Screen.AllScreens.GetLowerBound (0); I <= Screen.AllScreens.GetUpperBound (0); i++)
System.Windows.Forms.Application.Run (New ScreenSaverForm (i));
}
}
}
}
ScreenSaverForm.cs
Using System;
Using System.Drawing;
Using System.Windows.Forms;
Namespace ScreenSaver
{
public class ScreenSaverForm:System.Windows.Forms.Form
{
Private point mousexy;
private int screennumber;
private void Onmouseevent (object sender, System.Windows.Forms.MouseEventArgs e)
{
if (! Mousexy.isempty)
{
if (mousexy!= new Point (e.x, e.y))
Close ();
if (E.clicks > 0)
Close ();
}
mousexy = new Point (e.x, e.y);
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.