windows定时任务小注
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(args));
}
}
private bool blIsAuto = false;
public Form1(string[] args)
{
InitializeComponent();
this.Load += new EventHandler(Form1_Load);
if (args != null && args.Length == && args[] == "IsAuto")
{
blIsAuto = true;
}
} void Form1_Load(object sender, EventArgs e)
{
if (blIsAuto)
{
button1.PerformClick();
}
} private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("一条大河波浪宽");
if (this.blIsAuto)
{
this.Dispose();
Environment.Exit();
}
}
其中args提供触发的条件

如图,isAuto就是触发的条件
windows定时任务小注的更多相关文章
- windows 定时任务:schtasks,定时关闭网易云音乐
大部分属于转载和粘贴. 使用命令:schtasks windows 定时任务 使用样例: 每天定时关闭网易云音乐: 每天22:20关闭网易云音乐: schtasks /create /tn &qu ...
- windows 定时任务 - 定时关机
添加定时关机,刚好可以利用windows定时任务 [开始]->[控制面板]->[任务计划]->[添加任务计划] 1.找到 shutdown.exe 设置每天执行 2.设置晚上10点 ...
- windows 定时任务 设置 安全事项
windows 定时任务 设置 安全事项 1.如果是oaadmin/administrator 创建oracle 数据库. 安全选项如下: 1.只是在用户登录时候运行. sample: data ho ...
- .NET创建Windows定时任务
创建Windows定时任务教程 1.创建一个控制台应用程序,保证程序正常运行. 2.右键点击我的电脑->点击管理. 3.在计算机管理弹出框->展开计算机管理(本地)->展开系统工具- ...
- .net core+topshelf+quartz创建windows定时任务服务
.net core+topshelf+quartz创建windows定时任务服务 准备工作 创建.net core 控制台应用程序,这里不做过多介绍 添加TopShelf包:TopShelf: 添加Q ...
- Windows定时任务下载linux服务器批量文件到本地
编写批文件 1.1 编写main.bat文件 E: cd logs ftp -n -s:"E:\logs\mget.bat" 1.2 编写mget.bat文件 open ip地址 ...
- windows 定时任务
创建定时任务 创建定时任务,时间间隔为1min,开始时间为04:00:00,任务名称为backupSchedule,运行当前目录下的copyData.bat脚本 schtasks /create /s ...
- Windows 定时任务对数据库进行操作
定时对数据库进行操作可以用mysql的event事件来完成,但是只有mysql5.1后的才支持,所以有一定的局限性,也可以通过其他的mysql管理软件实现,而我发现Windows本身就有个定时任务的功 ...
- 如何配置windows定时任务
Windows上配置任务定时执行有两种方法.一是通过控制面板中的界面配置,另外一种是通过schtasks命令配置.如果是简单的定时任务配置(比如每天单次执行)建议选择界面的方式,简洁.直观.易上手.如 ...
随机推荐
- sqlserver 拷贝同步多个表数据到另一张表
--/****** Script for SelectTopNRows command from SSMS ******/ Insert into [DMSBusiness].[dbo].[Busin ...
- LeetCode: 292 Nim Game(easy)
题目: You are playing the following Nim Game with your friend: There is a heap of stones on the table, ...
- NDK环境搭建(Native Code的编译,不需要Cygwin)
分类: android2013-06-21 15:49 475人阅读 评论(0) 收藏 举报 Android NDK 目录(?)[-] System and Software Requirements ...
- perl 安装LOG4perl 模块
环境信息 ubuntu 12.04 64位 桌面版 Log-Log4perl 的介绍网址:http://search.cpan.org/~mschilli/Log-Log4perl-1.49/lib/ ...
- TensorFlow数据集(二)——数据集的高层操作
参考书 <TensorFlow:实战Google深度学习框架>(第2版) 一个使用数据集进行训练和测试的完整例子. #!/usr/bin/env python # -*- coding: ...
- 使用MethodSwizzle导致按home app进入后台或者app间切换发生crash的解决方法
参考文章: 1.http://blog.csdn.net/alincexiaohao/article/details/45913857 2.http://www.cocoachina.com/ios/ ...
- js监听键盘提交表单
<!DOCTYPE html> <html> <head> <title>登陆系统</title> <link href=" ...
- github网页样式
- Java内置锁和简单用法
一.简单的锁知识 关于内置锁 Java具有通过synchronized关键字实现的内置锁,内置锁获得锁和释放锁是隐式的,进入synchronized修饰的代码就获得锁,走出相应的代码就释放锁. jav ...
- SpringMVC之 HandlerAdapter和handlerMapping
HandlerAdapter字面上的意思就是处理适配器,它的作用用一句话概括就是调用具体的方法对用户发来的请求来进行处理.当handlerMapping获取到执行请求的controller时,Disp ...