Home > Net >  Asp.net call local program always tip can't find the right path to the file, how to solve
Asp.net call local program always tip can't find the right path to the file, how to solve

Time:10-07

Make a button in asp.net, to call the local qq program
Run QQ

The function open_qq () {
Var strpath;
Strpath='file:///D:/Program Files (x86)/Bin/QQ/Tencent QQ. Exe';
Try {
Var objshell=new ActiveXObject (" wscript. Shell ");
Objshell. Run (strpath);
Objshell=null;
}
The catch (e) {
Alert (' correct path can't find the files' + strpath);
}
}

But after the operation is always prompt can not find the file "correct path file:///D:/Program Files (x86)/Bin/QQ/Tencent QQ. Exe", is strpath format is wrong or else can't find the problem, still hope help
First thanks

CodePudding user response:

Don't say browser security reasons, only location is not likely to

As for the qq, it use is directly, tencent://message/? Uin=290201967

CodePudding user response:

Qq is just for an example, the other program is a phenomenon, give advice or comments

CodePudding user response:

ActiveXObject browser must be allowed to perform to run
But after the operation is always prompt can not find the file "correct path, catch to abnormal, check the try some
You can remove the try catch, and then see the specific error
  • Related