package and invoke external EXE from web app

rcook

New member
Joined
Sep 12, 2009
Messages
4
Programming Experience
10+
I want to invoke an executable as part of the logic of my web app. It converts data from a proprietary format to a known format that I want, I have no source or DLL for it, so I just need to create a file for it to work on, have it create another file, and use the result. I have it working in my development environment with a hard-coded directory path for the executable, and use of System.IO.Path.GetTempFilename to get temp names for the input and output files.

I want to do two things: package the executable as part of my web app, so that it goes into my bin directory along with my .dll and other such runtime web stuff, and I want to be able to invoke the executable from that directory.

I'm having an inordinate amount of trouble finding that directory at runtime. My Big Fat Book tells me that My.Application contains information about my app in a "web forms world", but intellisense in VS2008 doesn't recognize My.Application at all. After a lot of futzing and way too much trial-and-error, I found AppDomain.CurrentDomain.BaseDirectory in another forum, and it *seems* to be working. Is that the correct way to do this?

And how do I include this executable?

And is my GetTempFilename method viable in the general web application world? It would be nice if it went somewhere that my code could go to and clean up old files later.

tia,
rc
 
Back
Top