- Server Error in '/app_suite' Application.
-
-
The system cannot find the file specified
-
-
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
-
-
Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified
-
-
Source Error:
-
-
-
Line 201: process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
Line 202: process.StartInfo.RedirectStandardOutput = True
-
-
Line 203: process.Start()
-
-
Line 204: process.WaitForExit()
-
Line 205: Dim sr As StreamReader = process.StandardError
-
-
Source File: D:\inetpub\wwwroot\app_suite\new_program.aspx.vb Line: 203
-
-
Stack Trace:
-
-
-
[Win32Exception (0x80004005): The system cannot find the file specified]
-
System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) +1806
-
System.Diagnostics.Process.Start() +69
-
new_program.btncompile_Click(Object sender, EventArgs e) in D:\inetpub\wwwroot\app_suite\new_program.aspx.vb:203
-
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
-
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
-
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
-
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
-
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
-
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
-
-
Version Information: Microsoft .NET Framework Version:2.0.50727.4984; ASP.NET Version:2.0.50727.4971
From the code around lines 203 it's probably failing to compile the java source files perhaps because the java compiler javac is not there (or not on the path) or the java source files themselves are missing.
16 4078
We would need to see the code that throws the error.
- Imports System.Data.SqlClient
-
Imports System.IO
-
Imports System.IO.File
-
Imports System.Diagnostics
-
Partial Class new_program
-
Inherits System.Web.UI.Page
-
Dim conn As SqlConnection
-
Dim comm As SqlCommand
-
Public ds As Data.DataSet
-
Public da As SqlDataAdapter
-
Public cs As String = System.Configuration.ConfigurationSettings.AppSettings.Item("connection_string")
-
Public user_id As Integer
-
Public program_id As Integer
-
Public language_id As Integer
-
Public program_text As String
-
Public program_title As String
-
Public flag As Integer = 0
-
-
Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
-
If txttitle.Text.Contains(" ") Then
-
lblshow.Text = "*Please remove space from Program Title"
-
Else
-
If Request.QueryString("action") = "edit" Then
-
program_id = Request.QueryString("program_id")
-
conn = New SqlConnection(cs)
-
conn.Open()
-
da = New SqlDataAdapter
-
da.SelectCommand = New SqlCommand
-
da.SelectCommand.Connection = conn
-
da.SelectCommand.CommandText = "program_update"
-
da.SelectCommand.CommandType = Data.CommandType.StoredProcedure
-
da.SelectCommand.Parameters.AddWithValue("@program_id", program_id)
-
da.SelectCommand.Parameters.AddWithValue("@program_title", Trim(txttitle.Text))
-
da.SelectCommand.Parameters.AddWithValue("@program_text", txtcode.Text)
-
da.SelectCommand.Parameters.AddWithValue("@language_id", DropDownList1.SelectedValue)
-
da.SelectCommand.ExecuteNonQuery()
-
Response.Redirect("manage_programs.aspx?msg=update")
-
Else
-
-
user_id = CType(Session("aid"), Integer)
-
conn = New SqlConnection(cs)
-
conn.Open()
-
da = New SqlDataAdapter
-
da.SelectCommand = New SqlCommand
-
da.SelectCommand.Connection = conn
-
da.SelectCommand.CommandText = "program_insert"
-
da.SelectCommand.CommandType = Data.CommandType.StoredProcedure
-
da.SelectCommand.Parameters.AddWithValue("@user_id", user_id)
-
da.SelectCommand.Parameters.AddWithValue("@program_title", Trim(txttitle.Text))
-
da.SelectCommand.Parameters.AddWithValue("@program_text", txtcode.Text)
-
da.SelectCommand.Parameters.AddWithValue("@language_id", DropDownList1.SelectedValue)
-
da.SelectCommand.ExecuteNonQuery()
-
'ds = New Data.DataSet
-
'da.Fill(ds, "faculty_insert")
-
Response.Redirect("manage_programs.aspx?msg=save")
-
-
End If
-
End If
-
-
End Sub
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
lblargs.Text = ""
-
If CheckBox1.Checked Then
-
txtargs.Enabled = True
-
Else
-
txtargs.Enabled = False
-
End If
-
lblshow.Text = ""
-
If DropDownList1.SelectedValue = 3 Then
-
lblshow.Text = "*Class Name of Program and Program Title Should be Same"
-
End If
-
If Request.QueryString("action") = "edit" And Me.IsPostBack = False Then
-
program_id = Request.QueryString("program_id")
-
conn = New SqlConnection(cs)
-
conn.Open()
-
da = New SqlDataAdapter
-
da.SelectCommand = New SqlCommand
-
da.SelectCommand.Connection = conn
-
da.SelectCommand.CommandText = "program_select"
-
da.SelectCommand.CommandType = Data.CommandType.StoredProcedure
-
da.SelectCommand.Parameters.AddWithValue("@program_id", program_id)
-
ds = New Data.DataSet
-
da.Fill(ds, "program_select")
-
program_title = ds.Tables("program_select").Rows(0).Item("program_title")
-
program_text = ds.Tables("program_select").Rows(0).Item("program_text")
-
language_id = ds.Tables("program_select").Rows(0).Item("language_id")
-
DropDownList1.SelectedValue = language_id
-
txttitle.Text = program_title
-
txtcode.Text = program_text
-
End If
-
End Sub
-
Function InstanceCount(ByVal StringToSearch As String, ByVal StringToFind As String) As Integer
-
If Len(StringToFind) Then
-
InstanceCount = UBound(Split(StringToSearch, StringToFind))
-
End If
-
End Function
-
Protected Sub btncompile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btncompile.Click
-
If DropDownList1.SelectedValue = 1 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("Csharp/" + txttitle.Text + ".cs"))) Then
-
fs = File.Create(Server.MapPath("Csharp/" + txttitle.Text + ".cs"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("Csharp/" + txttitle.Text + ".cs")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("Csharp/" + txttitle.Text + ".cs"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Csharp\")
-
process.StartInfo.FileName = "csc"
-
Dim p As String = txttitle.Text + ".cs"
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.RedirectStandardOutput = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response As String = sr.ReadToEnd
-
process.Close()
-
response = response.Remove(0, 165)
-
If response.Trim = "" Then
-
lblerror.ForeColor = Drawing.Color.Green
-
lblerror.Text = "No Error Found"
-
lbldesc.Text = "Success"
-
Else
-
Dim errcnt As Integer = InstanceCount(response, txttitle.Text)
-
lblerror.ForeColor = Drawing.Color.Red
-
lblerror.Text = errcnt.ToString + " errors found:"
-
response = response.Replace(txttitle.Text, "<br/>" + txttitle.Text)
-
lbldesc.Text = response
-
End If
-
ElseIf DropDownList1.SelectedValue = 2 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("VB/" + txttitle.Text + ".vb"))) Then
-
fs = File.Create(Server.MapPath("VB/" + txttitle.Text + ".vb"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("VB/" + txttitle.Text + ".vb")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("VB/" + txttitle.Text + ".vb"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("VB\")
-
process.StartInfo.FileName = "vbc"
-
Dim p As String = Server.MapPath("VB\" + txttitle.Text + ".vb")
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.RedirectStandardOutput = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response As String = sr.ReadToEnd
-
process.Close()
-
-
If response = "" Then
-
lblerror.ForeColor = Drawing.Color.Green
-
lblerror.Text = "No Error Found"
-
lbldesc.Text = "Success"
-
Else
-
Dim len As Integer = response.Length
-
Dim errcnt As String = response.Remove(0, len - 10)
-
lblerror.ForeColor = Drawing.Color.Red
-
lblerror.Text = errcnt + "found:"
-
Dim a As String = response.Replace("D:\Project_2011-2012\App_suite_for_Cloud\app_suite\VB\", "* ")
-
a = a.Remove(a.Length - 10, 9)
-
lbldesc.Text = a.Replace("^", "<br/>")
-
End If
-
ElseIf DropDownList1.SelectedValue = 3 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("Java/" + txttitle.Text + ".java"))) Then
-
fs = File.Create(Server.MapPath("Java/" + txttitle.Text + ".java"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("Java/" + txttitle.Text + ".java")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("Java/" + txttitle.Text + ".java"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
-
process.StartInfo.FileName = "javac"
-
Dim p As String = txttitle.Text + ".java"
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardError
-
Dim response As String = sr.ReadToEnd
-
process.Close()
-
If response = "" Then
-
lblerror.ForeColor = Drawing.Color.Green
-
lblerror.Text = "No Error Found"
-
lbldesc.Text = "Success"
-
Else
-
Dim len As Integer = response.Length
-
Dim errcnt As String = response.Remove(0, len - 10)
-
lblerror.ForeColor = Drawing.Color.Red
-
lblerror.Text = errcnt + "found:"
-
-
-
-
Dim a As String = response.Replace("D:\inetpub\wwwroot\app_suite\Java\", "* ")
-
s
-
-
-
a = a.Remove(a.Length - 10, 9)
-
lbldesc.Text = a.Replace("^", "<br/>")
-
End If
-
-
ElseIf DropDownList1.SelectedValue = 4 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("HTML/" + txttitle.Text + ".html"))) Then
-
fs = File.Create(Server.MapPath("HTML/" + txttitle.Text + ".html"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("HTML/" + txttitle.Text + ".html")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("HTML/" + txttitle.Text + ".html"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
-
End If
-
-
End Sub
-
-
-
Protected Sub btnrun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnrun.Click
-
-
If CheckBox1.Checked Then
-
If Trim(txtargs.Text) = "" Then
-
lblargs.Text = "Please provide argumnets."
-
Else
-
flag = 1
-
If DropDownList1.SelectedValue = 1 Then
-
flag = 1
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Csharp\")
-
process.StartInfo.FileName = Server.MapPath("Csharp\") + txttitle.Text + ".exe"
-
p = txtargs.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 2 Then
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Vb\")
-
process.StartInfo.FileName = Server.MapPath("VB\") + txttitle.Text + ".exe"
-
p = txttitle.Text + " " + txtargs.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 3 Then
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
-
process.StartInfo.FileName = "java"
-
p = txttitle.Text + " " + txtargs.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 4 Then
-
Dim url As String
-
url = "~/HTML/" & txttitle.Text & ".html"
-
Response.Redirect(url)
-
-
-
End If
-
-
End If
-
Else
-
If DropDownList1.SelectedValue = 1 Then
-
flag = 1
-
'Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Csharp\")
-
process.StartInfo.FileName = Server.MapPath("Csharp\") + txttitle.Text + ".exe"
-
'p = ".exe"
-
'process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 2 Then
-
flag = 1
-
Dim p As String
-
Dim process As New Process
-
-
process.StartInfo.WorkingDirectory = Server.MapPath("Vb\")
-
process.StartInfo.FileName = Server.MapPath("VB\") + txttitle.Text + ".exe"
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 3 Then
-
flag = 1
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
-
process.StartInfo.FileName = "java"
-
p = txttitle.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
-
ElseIf DropDownList1.SelectedValue = 4 Then
-
Dim url As String
-
url = "~/HTML/" & txttitle.Text & ".html"
-
Response.Redirect(url)
-
-
End If
-
-
End If
-
-
-
End Sub
-
End Class
-
And which line throws the error?
It sounds like the path of the file doesn't exist. I would check the path that it's trying to access. Not the path that you think it's accessing, but the path it is actually trying to access.
wht ur r saying im not getting it coulde u plz ellaborate it.
You had another thread with the same problem (I can't find it anymore), anyway, you are trying to execute a command on line 203 in your code. The command is setup just before those lines. Either that command doesn't exist or it expects a file that doesn't exist. We don't know what that command is since you didn't show that code that creates it.
this is the code - Imports System.Data.SqlClient
-
Imports System.IO
-
Imports System.IO.File
-
Imports System.Diagnostics
-
Partial Class new_program
-
Inherits System.Web.UI.Page
-
Dim conn As SqlConnection
-
Dim comm As SqlCommand
-
Public ds As Data.DataSet
-
Public da As SqlDataAdapter
-
Public cs As String = System.Configuration.ConfigurationSettings.AppSettings.Item("connection_string")
-
Public user_id As Integer
-
Public program_id As Integer
-
Public language_id As Integer
-
Public program_text As String
-
Public program_title As String
-
Public flag As Integer = 0
-
-
Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
-
If txttitle.Text.Contains(" ") Then
-
lblshow.Text = "*Please remove space from Program Title"
-
Else
-
If Request.QueryString("action") = "edit" Then
-
program_id = Request.QueryString("program_id")
-
conn = New SqlConnection(cs)
-
conn.Open()
-
da = New SqlDataAdapter
-
da.SelectCommand = New SqlCommand
-
da.SelectCommand.Connection = conn
-
da.SelectCommand.CommandText = "program_update"
-
da.SelectCommand.CommandType = Data.CommandType.StoredProcedure
-
da.SelectCommand.Parameters.AddWithValue("@program_id", program_id)
-
da.SelectCommand.Parameters.AddWithValue("@program_title", Trim(txttitle.Text))
-
da.SelectCommand.Parameters.AddWithValue("@program_text", txtcode.Text)
-
da.SelectCommand.Parameters.AddWithValue("@language_id", DropDownList1.SelectedValue)
-
da.SelectCommand.ExecuteNonQuery()
-
Response.Redirect("manage_programs.aspx?msg=update")
-
Else
-
-
user_id = CType(Session("aid"), Integer)
-
conn = New SqlConnection(cs)
-
conn.Open()
-
da = New SqlDataAdapter
-
da.SelectCommand = New SqlCommand
-
da.SelectCommand.Connection = conn
-
da.SelectCommand.CommandText = "program_insert"
-
da.SelectCommand.CommandType = Data.CommandType.StoredProcedure
-
da.SelectCommand.Parameters.AddWithValue("@user_id", user_id)
-
da.SelectCommand.Parameters.AddWithValue("@program_title", Trim(txttitle.Text))
-
da.SelectCommand.Parameters.AddWithValue("@program_text", txtcode.Text)
-
da.SelectCommand.Parameters.AddWithValue("@language_id", DropDownList1.SelectedValue)
-
da.SelectCommand.ExecuteNonQuery()
-
'ds = New Data.DataSet
-
'da.Fill(ds, "faculty_insert")
-
Response.Redirect("manage_programs.aspx?msg=save")
-
-
End If
-
End If
-
-
End Sub
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
lblargs.Text = ""
-
If CheckBox1.Checked Then
-
txtargs.Enabled = True
-
Else
-
txtargs.Enabled = False
-
End If
-
lblshow.Text = ""
-
If DropDownList1.SelectedValue = 3 Then
-
lblshow.Text = "*Class Name of Program and Program Title Should be Same"
-
End If
-
If Request.QueryString("action") = "edit" And Me.IsPostBack = False Then
-
program_id = Request.QueryString("program_id")
-
conn = New SqlConnection(cs)
-
conn.Open()
-
da = New SqlDataAdapter
-
da.SelectCommand = New SqlCommand
-
da.SelectCommand.Connection = conn
-
da.SelectCommand.CommandText = "program_select"
-
da.SelectCommand.CommandType = Data.CommandType.StoredProcedure
-
da.SelectCommand.Parameters.AddWithValue("@program_id", program_id)
-
ds = New Data.DataSet
-
da.Fill(ds, "program_select")
-
program_title = ds.Tables("program_select").Rows(0).Item("program_title")
-
program_text = ds.Tables("program_select").Rows(0).Item("program_text")
-
language_id = ds.Tables("program_select").Rows(0).Item("language_id")
-
DropDownList1.SelectedValue = language_id
-
txttitle.Text = program_title
-
txtcode.Text = program_text
-
End If
-
End Sub
-
Function InstanceCount(ByVal StringToSearch As String, ByVal StringToFind As String) As Integer
-
If Len(StringToFind) Then
-
InstanceCount = UBound(Split(StringToSearch, StringToFind))
-
End If
-
End Function
-
Protected Sub btncompile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btncompile.Click
-
If DropDownList1.SelectedValue = 1 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("Csharp/" + txttitle.Text + ".cs"))) Then
-
fs = File.Create(Server.MapPath("Csharp/" + txttitle.Text + ".cs"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("Csharp/" + txttitle.Text + ".cs")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("Csharp/" + txttitle.Text + ".cs"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Csharp\")
-
process.StartInfo.FileName = "csc"
-
Dim p As String = txttitle.Text + ".cs"
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.RedirectStandardOutput = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response As String = sr.ReadToEnd
-
process.Close()
-
response = response.Remove(0, 165)
-
If response.Trim = "" Then
-
lblerror.ForeColor = Drawing.Color.Green
-
lblerror.Text = "No Error Found"
-
lbldesc.Text = "Success"
-
Else
-
Dim errcnt As Integer = InstanceCount(response, txttitle.Text)
-
lblerror.ForeColor = Drawing.Color.Red
-
lblerror.Text = errcnt.ToString + " errors found:"
-
response = response.Replace(txttitle.Text, "<br/>" + txttitle.Text)
-
lbldesc.Text = response
-
End If
-
ElseIf DropDownList1.SelectedValue = 2 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("VB/" + txttitle.Text + ".vb"))) Then
-
fs = File.Create(Server.MapPath("VB/" + txttitle.Text + ".vb"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("VB/" + txttitle.Text + ".vb")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("VB/" + txttitle.Text + ".vb"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("VB\")
-
process.StartInfo.FileName = "vbc"
-
Dim p As String = Server.MapPath("VB\" + txttitle.Text + ".vb")
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.RedirectStandardOutput = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response As String = sr.ReadToEnd
-
process.Close()
-
-
If response = "" Then
-
lblerror.ForeColor = Drawing.Color.Green
-
lblerror.Text = "No Error Found"
-
lbldesc.Text = "Success"
-
Else
-
Dim len As Integer = response.Length
-
Dim errcnt As String = response.Remove(0, len - 10)
-
lblerror.ForeColor = Drawing.Color.Red
-
lblerror.Text = errcnt + "found:"
-
Dim a As String = response.Replace("D:\Project_2012-2013\App_suite_for_Cloud\app_suite\VB\", "* ")
-
a = a.Remove(a.Length - 10, 9)
-
lbldesc.Text = a.Replace("^", "<br/>")
-
End If
-
ElseIf DropDownList1.SelectedValue = 3 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("Java/" + txttitle.Text + ".java"))) Then
-
fs = File.Create(Server.MapPath("Java/" + txttitle.Text + ".java"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("Java/" + txttitle.Text + ".java")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("Java/" + txttitle.Text + ".java"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
-
process.StartInfo.FileName = "javac"
-
Dim p As String = txttitle.Text + ".java"
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardError
-
Dim response As String = sr.ReadToEnd
-
process.Close()
-
If response = "" Then
-
lblerror.ForeColor = Drawing.Color.Green
-
lblerror.Text = "No Error Found"
-
lbldesc.Text = "Success"
-
Else
-
Dim len As Integer = response.Length
-
Dim errcnt As String = response.Remove(0, len - 10)
-
lblerror.ForeColor = Drawing.Color.Red
-
lblerror.Text = errcnt + "found:"
-
Dim a As String = response.Replace("D:\Project_2012-2013\App_suite_for_Cloud\app_suite\Java\", "* ")
-
a = a.Remove(a.Length - 10, 9)
-
lbldesc.Text = a.Replace("^", "<br/>")
-
End If
-
-
ElseIf DropDownList1.SelectedValue = 4 Then
-
Dim fs As FileStream = Nothing
-
If (Not File.Exists(Server.MapPath("HTML/" + txttitle.Text + ".html"))) Then
-
fs = File.Create(Server.MapPath("HTML/" + txttitle.Text + ".html"))
-
Using fs
-
End Using
-
End If
-
If File.Exists(Server.MapPath("HTML/" + txttitle.Text + ".html")) Then
-
Using sw As StreamWriter = New StreamWriter(Server.MapPath("HTML/" + txttitle.Text + ".html"))
-
sw.Write(txtcode.Text)
-
End Using
-
End If
-
-
End If
-
-
End Sub
-
-
-
Protected Sub btnrun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnrun.Click
-
-
If CheckBox1.Checked Then
-
If Trim(txtargs.Text) = "" Then
-
lblargs.Text = "Please provide argumnets."
-
Else
-
flag = 1
-
If DropDownList1.SelectedValue = 1 Then
-
flag = 1
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Csharp\")
-
process.StartInfo.FileName = Server.MapPath("Csharp\") + txttitle.Text + ".exe"
-
p = txtargs.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 2 Then
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Vb\")
-
process.StartInfo.FileName = Server.MapPath("VB\") + txttitle.Text + ".exe"
-
p = txttitle.Text + " " + txtargs.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 3 Then
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
-
process.StartInfo.FileName = "java"
-
p = txttitle.Text + " " + txtargs.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 4 Then
-
Dim url As String
-
url = "~/HTML/" & txttitle.Text & ".html"
-
Response.Redirect(url)
-
-
-
End If
-
-
End If
-
Else
-
If DropDownList1.SelectedValue = 1 Then
-
flag = 1
-
'Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Csharp\")
-
process.StartInfo.FileName = Server.MapPath("Csharp\") + txttitle.Text + ".exe"
-
'p = ".exe"
-
'process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 2 Then
-
flag = 1
-
Dim p As String
-
Dim process As New Process
-
-
process.StartInfo.WorkingDirectory = Server.MapPath("Vb\")
-
process.StartInfo.FileName = Server.MapPath("VB\") + txttitle.Text + ".exe"
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
ElseIf DropDownList1.SelectedValue = 3 Then
-
flag = 1
-
Dim p As String
-
Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
-
process.StartInfo.FileName = "java"
-
p = txttitle.Text
-
process.StartInfo.Arguments = p
-
process.StartInfo.UseShellExecute = False
-
process.StartInfo.RedirectStandardError = True
-
process.StartInfo.CreateNoWindow = True
-
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
-
process.StartInfo.RedirectStandardOutput = True
-
process.Start()
-
process.WaitForExit()
-
Dim sr As StreamReader = process.StandardOutput
-
Dim response1 As String = sr.ReadToEnd
-
process.Close()
-
lbloutput.Text = response1
-
-
ElseIf DropDownList1.SelectedValue = 4 Then
-
Dim url As String
-
url = "~/HTML/" & txttitle.Text & ".html"
-
Response.Redirect(url)
-
-
End If
-
-
End If
-
-
-
End Sub
-
End Class
-
From the code around lines 203 it's probably failing to compile the java source files perhaps because the java compiler javac is not there (or not on the path) or the java source files themselves are missing.
but i have set the path actually it's running in vs2008 and when i add this into iis7 it started to throw this error
Are you using a relative path? If you are, there's your problem. You changed the location of the file so now the relative path points to the wrong place.
plzz chk it and reply asap if possible
path - Dim process As New Process
-
process.StartInfo.WorkingDirectory = Server.MapPath("Java\")
Server.MapPath specifies a relative directory. If you move your file, then the path is no longer the same. Figure out what the new relative path is and specify it correctly. This is not something we can do for you because we have no idea how your directories are laid out.
An alternate option is to move the file you're trying to access into the same relative path.
thankx for ur suggestion it was very help full to me
my prblm is solved now
Glad you found your solution. Goodl uck with your project.
thank u very much
for ur replies
Sign in to post your reply or Sign up for a free account.
Similar topics
by: hangten |
last post by:
Does anyone know of an alternate command to invoke an executable other
than Process.Start ? I have a service that invokes an executabe. But
the service has minimal privs. and I'm getting an...
|
by: mg |
last post by:
c:\pdf\pdfmp3d.exe /c:\exportfiles /0 /0 /0 /0 runs correctly in the Command
Prompt.
But, not in the C# code behind of a WebForm:
...
|
by: Manfred Braun |
last post by:
Hi All,
the Process.Start method returns a boolean value to indicate, if a process
was started or not. Where can I obtain more detailed error information, if
the process could not be started ???...
|
by: Rod |
last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some
reason, opening some ASP.NET applications we wrote is producing the
following error message:
"The Web server reported...
|
by: Jm |
last post by:
Hi All
Im using a windows service program written in vb.net using the
system.diagnostics.process.start to open exe files but im getting few
strange problems that seem to be caused by the fact...
|
by: Dean Slindee |
last post by:
The code below is being used to launch WinWord.exe from a VB.NET program.
Word launches, but displays this error message:
"Word has experienced an error trying to open the file. Try these...
|
by: Dean Slindee |
last post by:
The code below is being used to launch WinWord.exe from a VB.NET program.
Word launches, but displays this error message:
"Word has experienced an error trying to open the file. Try these...
|
by: =?Utf-8?B?VkIgSm9ubmll?= |
last post by:
I am at my witless end here, please help!
I have an ASP.Net aspx web page, hosted on Windows Server 2003, that
receives a query string with the path to an autocad drawing file selected
from a...
|
by: stemp1ar |
last post by:
I am wondering if it possible to open a single process and run
multiple commands on that process and check standard error and
standard out after each command? Has anyone done something similar...
|
by: Bali |
last post by:
Hi
I have an ASP.NET application. I am on the server side and trying to
start an application which is on the server. The process gets
started(can be seen in the Task Manager) but doesn't do...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |