how can i add .exe file in asp.net 1.1
-
hi all i have a problem in my asp.net page i want to add .exe file in my aspx page,this .exe file can convert the english date into Arabic date and this conversion application is a desktop application,now we i want to embed this application in my asp.net.how can i get the solution of my problem. best regards
-
hi all i have a problem in my asp.net page i want to add .exe file in my aspx page,this .exe file can convert the english date into Arabic date and this conversion application is a desktop application,now we i want to embed this application in my asp.net.how can i get the solution of my problem. best regards
First of all, you cannot include an exe, but ofcourse you can execute.
You can pass your asp.net page variables as arguments to exe, also you can get return data from exe by writing it to some text file. Here is simple code snippet in C#:try
{
string yourArgs = "bla bla bla"; //This is the input parameter to exe System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = System.Web.HttpContext.Current.Server.MapPath("yourapplication.exe");
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = Path;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.Arguments = yourArgs;
p.EnableRaisingEvents = true;
p.Start();
p.WaitForExit();
p.Close();
p.Dispose();
}
catch (Exception exp)
{
//Write Code to handle exception here.
}Regards, Ketan.
-
First of all, you cannot include an exe, but ofcourse you can execute.
You can pass your asp.net page variables as arguments to exe, also you can get return data from exe by writing it to some text file. Here is simple code snippet in C#:try
{
string yourArgs = "bla bla bla"; //This is the input parameter to exe System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = System.Web.HttpContext.Current.Server.MapPath("yourapplication.exe");
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = Path;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.Arguments = yourArgs;
p.EnableRaisingEvents = true;
p.Start();
p.WaitForExit();
p.Close();
p.Dispose();
}
catch (Exception exp)
{
//Write Code to handle exception here.
}Regards, Ketan.
thnks but kindly if u give me some vb.net code snippet to execute the .exe form my asp.net applicion,it would be very healthy for me ... one more thing is that Can i give the path of my Install desktop application. would you like u tell me that running .exe from this way will not harmfull from the application. thnks bestRegards
-
thnks but kindly if u give me some vb.net code snippet to execute the .exe form my asp.net applicion,it would be very healthy for me ... one more thing is that Can i give the path of my Install desktop application. would you like u tell me that running .exe from this way will not harmfull from the application. thnks bestRegards
Hey, its not a big deal to convert this simple c# code to vb.net. Although, you can google for c# to vb.net converters and get the code converted. You can mention your dekstop application path whatever it is.
nabeelkhan wrote:
would you like u tell me that running .exe from this way will not harmfull from the application. thnks
I think you are a new player thats why asking such questions. X|
Regards, Ketan.
-
Hey, its not a big deal to convert this simple c# code to vb.net. Although, you can google for c# to vb.net converters and get the code converted. You can mention your dekstop application path whatever it is.
nabeelkhan wrote:
would you like u tell me that running .exe from this way will not harmfull from the application. thnks
I think you are a new player thats why asking such questions. X|
Regards, Ketan.
thnks ketan, i will try and let u know BestRegards nab
-
hi all i have a problem in my asp.net page i want to add .exe file in my aspx page,this .exe file can convert the english date into Arabic date and this conversion application is a desktop application,now we i want to embed this application in my asp.net.how can i get the solution of my problem. best regards
I'm not going to answer your question, but maybe you will find my post usefull anyway :) I realy wonder, why you want to execute desktop application from web application (that is quite weird) to convert dates from one calender to another, if .NET can do it for you as well. Check good example here on codeproject: http://www.codeproject.com/cs/samples/hijrigregorianclass.asp I hope it helps, it is much better solution for your problem, I think. Pilo