Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 27th, 2003, 03:21 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Running an .exe from an ASP.Net application

Ok, so I've got windows authentication working swell. My serurity IPrincipal returns the proper domain\username and is using NTLM. Now what I'm trying to do is run an .exe on the IIS machine when the user selects a button from the web page. Since the user is a domain user and is authenticated, should not ASP run the .exe using the session user credentials?

Here's the other problem (or maybe it's the same problem). I wrote a two line batch file to get a file from VSS. The first line is "set SSDIR=\\server\vss" and the second line uses the ss.exe Get function. When the user clicks the button on the web page, the IIS machine runs this batch file but the error code I get back is "srcsafe.ini not found. SSDIR was not set."

Well, the user accessing the website is actually the administrator of the IIS machine, so when ASP impersonates this user, the batch file should be run under his/her credentials (or so I understand it). It seems as though impersonation will not let me set an environment variable - even for a temporary console window?

I hope all of this makes sense. I didn't dumb down this post but I can if necessary. I'm sure that anyone with experience in what I'm trying to accomplish understands my position clearly, but then again, I'm a developer, not a teacher :)
  #2 (permalink)  
Old October 27th, 2003, 03:59 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm not sure what the answer is regarding the security issue, but I might be able to help with the VSS one.

I think the better way to do VSS operations would be to use the COM API. You can set up a project reference to the VSS API dll. Add a COM reference and look for "Microsoft SourceSafe 6.0 Type Library". Then you can just make your VSS calls from the code directly instead of needing to go thru a command shell.

Peter
  #3 (permalink)  
Old October 27th, 2003, 05:40 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So, just for fun (and while I wait for a solution and for my head to stop swelling.. ) I went ahead and used the COM interop for the SourceSafeTypLib. What a pain THAT was to implement :) Documentation I found was very inadequate. Regardless, I did get it implemented. I now have an .exe to do exactly what the batch file was doing. Now to call that .exe from the web. When I run the .exe from a command line it works as expected (gets the file from VSS and puts it in x:\) However, when using my code behind in my ASP.Net application to execute the .exe, it just fails silently. No debug output is available in this scenario :(. Anyhoo - the basic problem is still - credentials must not be getting passed as they are supposed to be I'm guessing. This is unbelievable :) Microsoft's policy on security must be that if they make it impossible to implement then that will make it impossible to crack? ;)

Disclaimer: I really am a Microsoft fan - just get frustrated :)
  #4 (permalink)  
Old October 27th, 2003, 05:50 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Why do you need an external EXE to do what you are doing? You should be able to do it all within the web application. That was my original intent suggesting that you use the VSS API. Perhaps that will solve your crudentials problem. If it's all being executed by the ASP process, and that process properly obtains the crudentials, then maybe that will work. You will have at least eliminated the one variable involving the step out to the command shell.

I know what you mean about the documentation, or lack thereof, for the VSS API. It's poor at best.

Peter
  #5 (permalink)  
Old October 27th, 2003, 06:52 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I already have a ton of code written that I am porting to the web via simple UI's and what not. The code is very componentized and reused in many many ways. One of the .exe's starts an NT service and monitors a MSMQ as well. The problem with putting it into the web app is that, as you have probably already guessed, would mean to slightly modified versions of the same code being used. It's just not feasible otherwise I agree, it would be great to just put it all into the web app.

HOWEVER - :) I did try putting a ProcessStartInfo/Process in the code behind on the web app that would get the file from VSS and that didn't work either. For some reason the web app wouldn't pass the credentials to the VSS server and hence couldn't "get" the file(s).

There is still the issue, whether in the web app itself or an external resource, of credentials.

Have you actually used the VSS API in a web app (a VSS server requiring windows authentication for logging into) and been successful? If so, I may be missing something very simple although I've been at this for over a week now and have posted on over 10 forums with no answers :(.

I'll try out any solution that someone may have though if it's feasible! :)

Thanks for the feedback.
  #6 (permalink)  
Old October 28th, 2003, 01:16 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

the only thing that I know about is, users should download .exe file & run it themself?! but u have Security problem, I myself will never download any exe file. I wonder why u need that, anyway... HTH

Always:),
Hovik Melkomian.
  #7 (permalink)  
Old October 28th, 2003, 03:44 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Melvik,

When a user goes to my website, they will hit a button that will run an .exe on the IIS server. Nothing client side here. :)

  #8 (permalink)  
Old October 29th, 2003, 12:50 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

no idea;)
Hovik.
  #9 (permalink)  
Old April 9th, 2005, 07:10 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I need to execute a exe file in webpage(in the same page itself insted of downloading and executing the application the local mechine)

its very urgent now plz send u r mail to as_prabahar@yahoo.com

  #10 (permalink)  
Old April 9th, 2005, 10:31 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

as_prabahar,I can't get your meaning,
let the user download the exe, and he would run it,explorers can't run exe files!

_____________
Mehdi.
software student.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
running .exe file in asp.net hotshot_21 ASP.NET 1.0 and 1.1 Basics 0 January 9th, 2006 08:32 AM
Error in running the .exe file of my application spc C# 0 November 28th, 2005 01:42 AM
Running exe from iis asp.net page mnazirkhalid@hotmail.com Classic ASP Components 2 February 21st, 2005 10:41 PM
running .exe file in web application exactlynn General .NET 0 May 5th, 2004 11:54 PM
running exe on asp Sarah Classic ASP Components 1 October 7th, 2003 10:53 PM



All times are GMT -4. The time now is 02:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.