Re: [問題] 如何關閉使用system開啟的程式?
根據熱心版大及版友的協助,
我上網東抄西抄生出了下面的程式,
這支程式會開啟IE,顯示指定的頁面,
並且在30秒後關閉開啟的process。
#!/usr/bin/perl
my $ProcessObj;
my $url = "http://tw.yahoo.com/";
use Win32::Process qw(STILL_ACTIVE);
use Win32;
Win32::Process::Create($ProcessObj,
"C:\\Progra~1\\Intern~1\\iexplore.exe",
"iexplore $url",
0,
NORMAL_PRIORITY_CLASS,
".")|| die ErrorReport();
$ProcessObj->Wait(30000);
$ProcessObj->GetExitCode( $exitcode );
print "Process completed with exit code $exitcode\n";
$ProcessObj->Kill($exitcode);
--
▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
國 立 聯 合 大 學
(理工/電資/管理/技術/客家)院所 招生中
National United University
───────────────────────────────────
首頁 http://www.nuu.edu.tw BBS telnet://uun.twbbs.org
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.133.145.202
※ 編輯: mosquito520 來自: 220.133.145.202 (01/19 15:42)
※ 編輯: mosquito520 來自: 220.133.145.202 (01/19 15:45)
討論串 (同標題文章)
完整討論串 (本文為第 3 之 4 篇):
Perl 近期熱門文章
PTT數位生活區 即時熱門文章
120
146
70
113