I need help with the code below. I try to convert a AutoCAD file from the format dwg to the format dwf. Then, the dwf file is downloaded and opened on the client computer using a java applet.
The command used to convert the dwg file on the command-line is: C:\inetpub\wwwroot\COR-Basic\cadviewer\converter\ax2008.exe -i="C:\inetpub\wwwroot\test\container\DU38_EG00_070116.dwg" -o="C:\inetpub\wwwroot\COR-Basic\cadviewer\files\DU38_EG00_070116.dwf" -f=dwf -model -text
this works when I enter the command text in cmd.exe.
But when I call it from my asp.net application, it only starts the process, but the process never ends...
I've tried adding an additional user, have given this user full permission, and full permissions on wwwroot, but it still doesn't work.
Anybody knows what I'm doing wrong, or how I could do it in another way?
If System.IO.File.Exists(strDWGlocation) Then
Dim psiProcessSettings As Diagnostics.ProcessStartInfo = New Diagnostics.ProcessStartInfo
psiProcessSettings.FileName = strApplicationPath
psiProcessSettings.Arguments = " -i=""" & strDWGlocation & """ -o=""" & strOutputLocation & """ -f=dwf -model -text"
'ST-LAPTOP\converter
psiProcessSettings.UserName = "converter"
psiProcessSettings.Password = secureString
'StefanSteiger.Debug.MsgBox("Input location:" + strDWGlocation)
'StefanSteiger.Debug.MsgBox("Output location:" + strOutputLocation)
Response.Write("<h1>Argument1: " + psiProcessSettings.Arguments + "</h1>")
Response.Write("<h1>Pfad1: " + psiProcessSettings.FileName + "</h1>")
'psiProcessSettings.RedirectStandardInput = True
psiProcessSettings.RedirectStandardError = True
psiProcessSettings.RedirectStandardOutput = True 'Redirect output so we can read it.
psiProcessSettings.UseShellExecute = False 'To redirect, we must not use shell execute.
'psiProcessSettings.CreateNoWindow = True ' don't create a window
Dim pConverterProcess As Diagnostics.Process = New Diagnostics.Process
pConverterProcess = Diagnostics.Process.Start(psiProcessSettings) 'Create the process.
pConverterProcess.Start() 'Execute the process.
'Response.Write("<h1>" + Replace(pConverterProcess.StandardOutput.ReadToEnd(), vbCrLf, "<BR />") + "</h1>") 'Send whatever was returned through the output to the client.
'pConverterProcess.CancelOutputRead()
'pConverterProcess.CancelErrorRead()
'pConverterProcess.StandardInput.Close()
'Wait for the process to end.
'pConverterProcess.WaitForExit()
pConverterProcess.Close()
'Dim iExitCode As Integer = pConverterProcess.ExitCode()
pConverterProcess.Dispose()
Else
MyNamespace.Debug.MsgBox("No such file.")
End If