This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / .net高手看过来现在用asp.net开发网站,想用网页上的摁钮触发服务器上的可执行文件,执行文件转换功能。用到vb.net里执行可执行文件的新增功能process。
但是这个可执行命令proecess.start("convert.exe","agument=xxx")只能在生成vb.net的windows application才能正常运行;在web application里,convert.exe在内存里呆一会就结束了,根本没用干他该干的事。执行其他的可执行文件如ping,cmd,dir就行,notepad,winword就挂在内存里没用任何反应。我该怎么办?
xiexie
-vega_lee(天津の包子.NET);
2003-11-19
{428}
(#1473138@0)
-
有没有权限问题?转换可能涉及到文件读写吧
-win(秋天的菠菜);
2003-11-19
(#1473166@0)
-
转换是在服务器本地运行的,不会吧?
-vega_lee(天津の包子.NET);
2003-11-19
(#1473171@0)
-
^^^
-vega_lee(天津の包子.NET);
2003-11-19
(#1473203@0)
-
help!!!
-vega_lee(天津の包子.NET);
2003-11-19
(#1473378@0)
-
哼哼不是dot net高手么
-vega_lee(天津の包子.NET);
2003-11-19
(#1473381@0)
-
I'm not 高手 and I never got your problem yet. I'll try it later. I like to meet new problem.
-henhen(哼哼, 找工ing ^_^);
2003-11-19
(#1473422@0)
-
不许破坏俺们心目中的偶像形象
-vega_lee(天津の包子.NET);
2003-11-19
(#1473517@0)
-
man, I can't get a position for myself. It's been six months. :-(
-henhen(哼哼, 找工ing ^_^);
2003-11-19
(#1473535@0)
-
别泄气,你水平比我高,找工作是时间问题
-vega_lee(天津の包子.NET);
2003-11-19
(#1473662@0)
-
donot like talk like that. do not count month, it does not mean too much and 6 is still very small number. You know the current market.
-win(秋天的菠菜);
2003-11-19
(#1473707@0)
-
Thank you guys, 菠菜core and 天津の包子.
-henhen(哼哼, 找工ing ^_^);
2003-11-19
(#1473766@0)
-
Please checking the rights for User: "ASPNET". Make sure this account has the proper previliages.
-benbendan(笨笨蛋);
2003-11-19
(#1473438@0)
-
好主意,多谢,去试试
-vega_lee(天津の包子.NET);
2003-11-19
(#1473499@0)
-
I give the aspnet user the administrator previliages. But still fail. :<
-vega_lee(天津の包子.NET);
2003-11-19
(#1473511@0)
-
The reason you can not see the gui of notepad and winword is because your webapp is running under different user other then the one you logged in. try thisrun Component Services under Control Panel\Administrative Tools, expand Component Services --> Computers -->My Computer --> COM+ Applications, find your web app, it should looks like IIS - {Default Web Site//Root/....} .Right click it,choose properties, then Identity tab, change Account to Interactive.
after that, restart your IIS server and try again.
-guestagain(guest again);
2003-11-19
{358}
(#1473554@0)
-
高手呀,这种方法您是怎么知道的?总算不像以前在内存里跳一下就出来了,可是在内存里呆着,什么都不干。也许干了,没什么结果。如果换成notepad的话,就在内存里没反应。我的命令行打开了相应程序,但是没有进一步。
-vega_lee(天津の包子.NET);
2003-11-19
(#1473738@0)
-
UP. I got the same outcoming.
-henhen(哼哼, 找工ing ^_^);
2003-11-19
(#1473902@0)
-
show your code, the process part
-guestagain(guest again);
2003-11-19
(#1473946@0)
-
no problem
-vega_lee(天津の包子.NET);
2003-11-19
{910}
(#1474002@0)
-
the code seems OK. when you run it as a web app, can you see the gui?
-guestagain(guest again);
2003-11-19
(#1474057@0)
-
I think it is correct too. The Notepad.exe only appears in memory ,no gui at all. Do you have experience to run windows application in asp.net?
-vega_lee(天津の包子.NET);
2003-11-19
(#1474081@0)
-
我没有试过直接在Asp.net的code里运行,我是用一个assembly来处理这些东东,然后asp或asp.net再调用该assembly。
-guestagain(guest again);
2003-11-19
(#1474193@0)
-
under COM+Applications, I gotIIS IN-Process Applications : right-click properties, identity is not available
IIS Out-of-Process Applications :........................................, set to interactive user..
This is the only one the Identity can be set to interavtive user.
But I still didn't get Notepad UI.
What's wrong?
-henhen(哼哼, 找工ing ^_^);
2003-11-20
{309}
(#1475613@0)
-
up
-henhen(哼哼, 找工ing ^_^);
2003-11-20
(#1475675@0)
-
check your Virtual Directory Properties, the Application Protection should choose High.
-guestagain(guest again);
2003-11-20
(#1475975@0)
-
救命!或者指教去什么地方问
-vega_lee(天津の包子.NET);
2003-11-19
(#1473832@0)
-
I don't see there is anything to do with dotnet. call windows application from asp.net. That's shit! why not make your windows application windows service, and keep it in memory all the time?
-miketany(MIKE老狼);
2003-11-19
(#1473987@0)
-
:-)I searched on google. They guys wanna do same but failed. ASP.NET handled by IIS, Desktop is unreachable on this point.
-henhen(哼哼, 找工ing ^_^);
2003-11-19
{119}
(#1474005@0)
-
It's true...... I can't believe it............
-vega_lee(天津の包子.NET);
2003-11-19
(#1474444@0)
-
In fact tha application is only a command line the convert some data files. I think someone may need to trigger some executable file when they want to exchange some data into another file format.
-vega_lee(天津の包子.NET);
2003-11-19
(#1474010@0)
-
I remind that my colleages once talked about that if you call unmanaged code from .net, there are some bothering security issues. error might be raised.
-win(秋天的菠菜);
2003-11-19
(#1474059@0)
-
It doesn't matter. We can use other way to protect. But how to realize it is emergency
-vega_lee(天津の包子.NET);
2003-11-19
(#1474088@0)
-
When you run any thing based on asp,the asp code will be using some windows application. If any mission is unavailable to the asp server, I have to make some windows application to work on it. No shit,there.
-vega_lee(天津の包子.NET);
2003-11-19
(#1474038@0)
-
Actually I was in the same situation before. I have learned that's really a bad idea. I use a tool to make the windows application running as a windows service. It works great.
-miketany(MIKE老狼);
2003-11-19
(#1474058@0)
-
windows services has its own issues.
-guestagain(guest again);
2003-11-19
(#1474080@0)
-
So you have experience about it. Could you tell me how? Thanks.
-vega_lee(天津の包子.NET);
2003-11-19
(#1474090@0)
-
1. Create a windows service application. 2. Call the command line file converting application from the windows service application.3. I suppose you generate some file in asp.net application to be converted. So listen to the file changes in the folder in your windows service application. When the windows service application learn there is a file created, call the command line application to do the work.
Windows Service usually running in administrator account, so there is no security problem.
-miketany(MIKE老狼);
2003-11-19
{368}
(#1474110@0)
-
贼心不死,接着顶
-vega_lee(天津の包子.NET);
2003-11-19
(#1474108@0)
-
checking the convert.exe's source code, make sue catch the run time error exceptions. Then let's go back to solve it.
-benbendan(笨笨蛋);
2003-11-19
(#1474179@0)
-
We buy a third party software. We don't have the source code. :(
-vega_lee(天津の包子.NET);
2003-11-19
(#1474439@0)
-
Complain to them
-benbendan(笨笨蛋);
2003-11-19
(#1474533@0)
-
It must be some exception when you run the convert in IIS. The problem is you can't catch the exception the process is raisedwhen you want to run it. ask them for a new version that can give you the error message.
-benbendan(笨笨蛋);
2003-11-19
{88}
(#1474568@0)
-
虽然我不太同意MIKE老狼关于windows services 的观点,但他的解决方案(#1474110)还是很好的,你可以试试。
-guestagain(guest again);
2003-11-19
(#1474642@0)
-
我试了一下,好像可以啊,可能是我没理解问题。
-xmlhttprequest(DataSet lover...);
2003-11-19
{893}
(#1474805@0)
-
你这个情况有一点点不一样,最简单的就是用notepad试。
-guestagain(guest again);
2003-11-19
(#1474857@0)
-
启动 notepad 的 user account 是 ASPNET,所以看是肯定看不到的。但是不晓得是否真的执行完毕了。另外,搂主的转换程序一定要 UI 么?比如只有 cmd 就不干活,但可以这么用:
private string TestConsole()
{
Process p = new Process();
p.StartInfo.Arguments = "/c dir"; // !!
p.StartInfo.UseShellExecute = false;
p.EnableRaisingEvents = false;
p.StartInfo.RedirectStandardOutput = true;
// p.StartInfo.FileName = "e:\\MyConsoleApp.exe";
p.StartInfo.FileName = "cmd.exe";
p.Start();
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
return output;
}
-xmlhttprequest(DataSet lover...);
2003-11-20
{445}
(#1475086@0)
-
#1473554
-guestagain(guest again);
2003-11-20
(#1475580@0)
-
我这么试过,什么设置都不变,一点问题也没有。但这个转换程序非要打开一次ppt才行,把权限设置好前,连ppt都不能打开,现在可以了,但是就死在这一步了,其实也不用我在ppt里干什么,都应该是自动,也不知怎么就不动。
-vega_lee(天津の包子.NET);
2003-11-20
(#1476226@0)
-
用Impersonation就是说在执行那段代码的时候相当于把当前线程的拥有者模仿为另外一个有高权限的用户。
-hardywang(Hardy);
2003-11-20
{80}
(#1475795@0)
-
up
-henhen(哼哼, 找工ing ^_^);
2003-11-20
(#1475850@0)
-
Up我干什么?
-hardywang(Hardy);
2003-11-20
(#1476077@0)
-
在machine.config里那个?好像在某论坛被人否了
-vega_lee(天津の包子.NET);
2003-11-20
(#1476158@0)
-
I guess it is because notepad need to read input from standard input(keyboard), so it will block there after you start it. Ping is not a interactive application, so it is OK.
-wnms2000(我欲乘风归去);
2003-11-20
(#1476306@0)
-
no at all. 我现在就是什么都不用干,就是打开一下powerpoint,再关上,都是自动的,就不行
-vega_lee(天津の包子.NET);
2003-11-20
(#1476409@0)
-
Why don't you use MS Office COM interface? It should work.
-bluebison(大牛);
2003-11-20
(#1476633@0)
-
高人,您说到点子上了,已经解决了
-vega_lee(天津の包子.NET);
2003-11-21
(#1477430@0)
-
解决方案,不看后悔,长知识呀
-vega_lee(天津の包子.NET);
2003-11-21
{2575}
(#1477433@0)
-
nice
-guestagain(guest again);
2003-11-21
(#1478771@0)
-
真不知道windows还有这么高级的应用,以前以为windows都知道的差不多了呢。这东西怎么学的?
-vega_lee(天津の包子.NET);
2003-11-22
(#1479132@0)