zoukankan
html css js c++ java
c#,windows service,system.threading.timer Virus
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Diagnostics;
using
System.ServiceProcess;
using
System.Text;
using
System.Windows.Forms;
using
System.Diagnostics;
using
Microsoft.Win32;
using
System.Threading;
namespace
WinSer
{
public
partial
class
Service1 : ServiceBase
{
System.Threading.Timer timer1
=
null
;
public
Service1()
{
InitializeComponent();
}
protected
override
void
OnStart(
string
[] args)
{
//
TODO: 在此处添加代码以启动服务。
timer1
=
new
System.Threading.Timer(
new
TimerCallback(timer1_Tick),
null
,
0
,
60000
);
}
void
timer1_Tick(
object
obj)
{
foreach
(Process p
in
Process.GetProcesses())
{
if
(p.ProcessName
==
"
Client
"
)
{
p.Kill();
return
;
}
}
}
protected
override
void
OnStop()
{
//
TODO: 在此处添加代码以执行停止服务所需的关闭操作。
}
}
}
【Blog】
http://virusswb.cnblogs.com/
【MSN】
jorden008@hotmail.com
【说明】转载请标明出处,谢谢
反馈文章质量,你可以通过快速通道评论:
查看全文
相关阅读:
C++学生成绩管理系统
蓝桥杯算法训练 最大最小公倍数
蓝桥杯基础练习 完美的代价
vim编辑器的使用技巧
C语言中static关键字的用法
在linux环境下编译运行OpenCV程序的两种方法
Linux中gcc编译器的用法
浅谈Java中的hashcode方法
读CopyOnWriteArrayList有感
徐汉彬:Web系统大规模并发——电商秒杀与抢购(技术实现)
原文地址:https://www.cnblogs.com/virusswb/p/1245348.html
最新文章
修改Typora的快捷键【markdown软件】
【13】自定义火狐快捷键
【12】Firefox 快捷键大全及更改和定制快捷键的方法
10.27-Redis-mz 深入浅出Redis
git与github
02.我有社保,为什么还要买保险?
s40 KVM虚拟化企业级实战
第35章-CentOS7实战
基金-2
1.基金训练营(新)
热门文章
(13)进阶投资者的心态
12 如何用网格策略网住收益?——实操篇
(11)波动的市场,网格助你锁定收益
Web购物车案例(servlet+bean+jsp)
CET4
JAVA基础知识注意事项
Computer English Notes
一个漂亮的js表单验证页面+验证码
php+js实现一个简单的用户管理系统
对于Serializable的理解
Copyright © 2011-2022 走看看