急,在线等!web service调用外部命令的问题!
小弟想写一个web service,利用process 类它来调用一个批处理文件,debug的时候都可以调用成功的,publish后,调用不出来了,查看任务管理器,其中有cmd.exe,但就是没有批处理运行的结果,看起来像是hang在哪里了。哪位大侠知道问题出在哪里了?
<WebMethod()> _
Public Function NotifyFIODBuildDone(ByVal source As String) As Integer
Dim fs As New Scripting.FileSystemObject
Dim ShellResult As Integer
Dim Proc As New Process
If fs.FileExists(source) Then
If fs.FileExists("c:" + "DistributeFIODIMG.BAT") Then
Proc.StartInfo.FileName = "c:\DistributeFIODIMG.BAT " + source
Proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal
Proc.StartInfo.CreateNoWindow = True
Proc.StartInfo.UseShellExecute = False
'Proc.StartInfo.Arguments = " /accepteula"
Proc.StartInfo.RedirectStandardOutput = True
Proc.Start()
Else
Return 2
End If
Else
Return 3
End If
Return ShellResult
End Function
[解决办法]
权限问题!!!!