Ciao,
lasciando perdere la questione sicurezza (Essendo in LAN), ho necessità di far eseguire un exe (o cmd o bat) dalla mia applicazione ASP.NET.
Ho già sguito tutti i tutorial dove dicono di creare un codice tipo questo:
Dim passwordPre As String = "password"
Dim passwordChars As Char() = passwordPre.ToCharArray()
Dim password As New System.Security.SecureString
For Each c As Char In passwordChars
password.AppendChar(c)
Next
Dim info As New ProcessStartInfo("C:\Test\WindowsApplication1.exe")
info.UseShellExecute = False
info.RedirectStandardInput = True
info.RedirectStandardError = True
info.RedirectStandardOutput = True
info.UserName = "administrator"
' see the link mentioned at the top
info.Password = password
Using install As Process = Process.Start(info)
Dim output As String = install.StandardOutput.ReadToEnd()
install.WaitForExit()
End Using
Ho già dato i permessi di esecuzione all'exe che voglio eseguire.
Quando lo eseguo parte, ma da task manager vedo che viene chiuso. Da registro eventi mi da un errore generico.
Sapete come aiutarmi, avendo già cercato ampliamente in rete?
Ciao