Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6541002
  • 博文数量: 1159
  • 博客积分: 12444
  • 博客等级: 上将
  • 技术积分: 12570
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-13 21:34
文章分类

全部博文(1159)

文章存档

2016年(126)

2015年(350)

2014年(56)

2013年(91)

2012年(182)

2011年(193)

2010年(138)

2009年(23)

分类: 系统运维

2012-04-22 17:33:40



Step 1. Type "about:config" in address bar and make "signed.applets.codebase-principal-support" true.
Step 2. Use this code.











++++++++++++++++++++++++++++++++++++++++++++++



-// test if an argument can be successfully passed to an application -// that will return -1 if "mozilla" is not the first argument -function test_arguments() -{ - var testapp = filePrefix + "TestArguments" + fileSuffix; - - var file = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); - file.initWithPath(testapp); - - var process = Components.classes["@mozilla.org/process/util;1"] - .createInstance(Components.interfaces.nsIProcess); - process.init(file); - - var args= ["mozilla"]; - - var pid = process.run(true, args, args.length); - - if (!pid) { - return false; - } - - if (process.exitValue) { - return false; - } - return true; -}

++++++++++++++++++++++




#include

int main(int argc, char* argv[]) {
if (argc != 9)
return -1;

if (strcmp("mozilla", argv[1]) != 0)
return 1;
if (strcmp("firefox", argv[2]) != 0)
return 2;
if (strcmp("thunderbird", argv[3]) != 0)
return 3;
if (strcmp("seamonkey", argv[4]) != 0)
return 4;
if (strcmp("foo", argv[5]) != 0)
return 5;
if (strcmp("bar", argv[6]) != 0)
return 6;
if (strcmp("argument with spaces", argv[7]) != 0)
return 7;
if (strcmp("\"argument with quotes\"", argv[8]) != 0)
return 8;

return 0;
}



阅读(1044) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~