|
i have attached exe file on asp.net page it was running well but when it was host to webserver it was creating problem.code given below:
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
// Set the directory where the file resides
process1.StartInfo.WorkingDirectory = Request.MapPath("~/");
// Set the filename name of the file you want to open
process1.StartInfo.FileName = Request.MapPath("hard_disk_serialNo.exe");
// Start the process
process1.Start();
Thanks in Advance
|
|
|
|
|
You are doing this thing in asp.net. And page is rendered on user machine. So the path you are giving should be present on user machine. Then perhaps you can make it run. By using the above process you can run any exe resident on the server. But exe will not be visible to the user.
I wonder what you want to do.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Now that's just not true - asp.net runs the code on the server side, so this will always run this code on the server.
|
|
|
|
|
AhsanS wrote: So the path you are giving should be present on user machine. Then perhaps you can make it run
Wrong, as in very.
AhsanS wrote: Senior Software Engineer
|
|
|
|
|
You can do it using activeX components. But most of the browsers disabled it by default because of security reason. So your idea is useless.
|
|
|
|
|
You have a number of problems here:
1. No browser would ever let you just run an exe file, for security reasons.
2. Your code (in asp.net), running on the server, will attempt to run this executable on the server, in all cases which is not, i think, what you want.
If you really need to do this, you'll need to code an applet or an ActiveX control.
|
|
|
|
|
There's a way to do this but i might have taken a longer path
First of all the EXE must be present in the client's machine. Next, client's IP should be present in your server (which you can get from Request parameters).
Next, you would need to take input (or perform a lookup) for client's Windows username and password.
And next, you can launch a WMI Script or an equivalent WMI code using System.Diagonistics.Process to execute the process in the client's IP with that username and password.
-------------------------------------------
It's code that drives you - Shyam
|
|
|
|
|
Hi,
I m trying to set errormessage as oSrc.errormessage for validation control in javascript code it displays msg dynamically on alert but i want it on the ErrorMeaage of validator,as it shows the previous erreormessage and not giving new message.
|
|
|
|
|
Hi Coders
I add a aspx page of a webapplication to another. After addition I found the Ajax Tools(Update Panel) and Validation Controls(Required Field,Regular Exxpression) are not working.
Any help will be apprieciated.
Amit
|
|
|
|
|
Is ur other webapplication also Ajax Enabled?
|
|
|
|
|
Hi,
How to get the optional parameters values of the LDAP.
Hanumanth
|
|
|
|
|
hi
how to pass values from one page to the other page in post mechanism in ASP.NET i know how to pass val;ue by get mechanism in which we pass in query string and fetch through Request.GetQueryString["ValuePassedinQuerystring"], but how can we do it through post mechnism, i should be very thankful if any one can provide me the code snippet for it, thankx in advance,
regards,
|
|
|
|
|
If you dont want to put the values you are passing to the next page on the query string, then you may have to use save them in session
|
|
|
|
|
If you are using cross page posting, then you can find controls in previous page and get it's values. Assume you have a textbox in previous page with id as txt, value of this textbox can be taken by TextBox txt = (TextBox)Page.PreviousPage.FindControl("txt")
All posted values will be available in Request.Forms collection.
|
|
|
|
|
hi all,
I developed a Asp.net web application and it works well in my local system.When i hosted the same i am getting the error
"Login failed for user ''. The user is not associated with a trusted SQL Server connection. "
What exactly happened to the project ?Can anybody help me in solving the same.
Thanks in advance,
|
|
|
|
|
SQL Server (or Express) you deployed the database to is only enabled for Windows Authentication. You need to enable both SQL and Windows Authentication. You may also need to use SQL Server Surface Area Configuration to allow both local and remote connections - TCP/IP and named pipes
|
|
|
|
|
How can i achieve the mixed mode in authentication,in web config we are not able to set mode="mixed" right? i think only windows or forms authentication is allowed there
|
|
|
|
|
Thats because you need to make the authentication mode mixed on SQL Server, not your web app.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi every one
I am a beginner in ASP.NET
I am working on sending Email, but unable to get it...
I am screwed up........., i have tried many codes in google but i am confused.
Please any one can give me steps to follow from beginning to end.
|
|
|
|
|
Hi kiranreddy,
Try this:
using System.Net.Mail;
protected void btnSendMessage_Click(object sender, EventArgs e)
{
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAdress = new MailAddress("YourSenderEmail", "NameThatSendTheMessage");
smtpClient.Host = "YoursmptClientHost";
smtpClient.Port = 25;
message.From = fromAdress;
message.To.Add("MailAdressToWhoShouldRecieveTheMail");
message.Subject = "The message subject";
message.IsBodyHtml = false;
message.Body = "The message went here";
smtpClient.Send(message);
lblSendOk.Visible = true;
}
catch (Exception ex)
{
lblSendError.Visible = true;
lblSendError.Text = lblSendError.Text + " .<br />" + ex.Message;
}
}
If you have any trouble with the above code, you have to tell what exactly the error gives and copy your code, so we can see, if you have done anything else.
Kind regards,
simsen
|
|
|
|
|
you have to use System.Net namesapce and use
MailMessage Class.
cheers,
Abhijit
|
|
|
|
|
Hi all,
How to convert System.Web.UI.WebControls.Table into System.Data.DataTable ?
i tried it by
System.Web.UI.WebControls.Table t=new System.Web.UI.WebControls.Table();
System.Data.DataTable dt = new System.Data.DataTable();
dt = (System.Data.DataTable)t;
Its giving Error.
Error 9 Argument '1': cannot convert from 'System.Web.UI.WebControls.Table' to 'System.Data.DataTable'
Please suggest me how to do that.
Thanks in advance.
|
|
|
|
|
There is no direct method for that. You have to implement a loop to copy values.
|
|
|
|
|
|
if you are trying to display the data in the page then use datagrid
Thanks & Regards
Pete
|
|
|
|