你的分享就是我们的动力 ---﹥

Perl 根据 Windows 的错误码获取详细的描述信息

时间:2013-05-30 00:05来源:www.chengxuyuans.com 点击:

代码简介

暂无

Perl代码片段

# This function takes the error number returned by the Win32::GetLastError function.
          
#!/usr/bin/perl -w

use Win32;

$ApplicationName = 'c:\winnt\system32\notepad.exe';
$CommandLine     = "notepad";

# Spawn the process.
$status = Win32::Spawn( $ApplicationName,$CommandLine,$ProcessId );

if ( $status != 0 ) {
    print "Launched process with ID $ProcessId.\n";
} else {    
    print "Failed to launch process.\n";
    print Win32::FormatMessage( Win32::GetLastError() );
}

转载注明地址:http://www.chengxuyuans.com/Perl/63096.html