Answer the question
In order to leave comments, you need to log in
How to run *.bat on the server using ASP?
Ideally, I would like a web face that runs a script with a parameter on the server
by pressing a button
like this
test.aspx
<%@ Page Language="C#" CodeFile="test.aspx.cs" Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Hallo Welt</title>
</head>
<body>
<form id="halloForm" runat="server">
Parametr: <asp:TextBox id="TbName" runat="server" />
<br />
<asp:Button ID="ButtonOk" Text="Test" runat="server" OnClick="ButtonOk_Click" />
<br />
<asp:Label ID="LabelHallo" runat="server"/>
</form>
</body>
</html>
using System;
using System.Web;
using System.Web.UI.WebControls;
using System.Diagnostics;
using System.ComponentModel;
public partial class _Default : System.Web.UI.Page
{
protected void ButtonOk_Click(object sender, EventArgs e)
{
Process.Start("C:\\Temp\\script.bat");
}
}
только незнаю как правильно синтаксически передать переменную
что бы получилось так
C:\Temp\script.bat переменная из формы
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question