Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to call a remote console application from an ASP.NET C# web application?

Posted on 2004-09-13
3
Medium Priority
?
455 Views
Last Modified: 2008-02-01
Hello folks,

The following code snippet causes an exception "Logon failure: unknown user name or bad password".

     Process p = new Process();
     p.StartInfo.UseShellExecute = false; // only executables; no docs like Run.
     p.StartInfo.RedirectStandardOutput = true;
     p.StartInfo.Arguments = @"www.yahoo.com";
     p.StartInfo.FileName = @"\\my-remote-machine-name\C$\WINDOWS\SYSTEM32\ping.exe";
     //p.StartInfo.FileName = "C:\\WINNT\\SYSTEM32\\ping.exe";
     p.StartInfo.CreateNoWindow = true;
     p.Start();
     string output = p.StandardOutput.ReadToEnd();
     p.WaitForExit();

To use shared folders in that remote machine, I supply my credentials.
How do I pass that user name and password for the above code to work?

Your help will be highly appreciated.

Thank you,
Parvinder
0
Comment
Question by:parvinderg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12046670
0
 

Author Comment

by:parvinderg
ID: 12058055
Thank you, that worked.

I added ASPNET as username and a cleartext password in machine.config.
Also I created ASPNET user on the remote machine.

I'm not sure if cleartext password in machine.config is safe.
And what privilages should the ASPNET account on the remote machine have?

PSG
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 1500 total points
ID: 12064964
I am afraid that I can't really help you with these supplemental questions as I am just learning .Net now. Perhaps you might ask these in the ASP.Net topic area?

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/

Perhaps someone there can help.

Good luck,

FtB
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question