Re: Getting the full path of a folder.

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



If you want to keep a virtual path, you'll need also to know the web site so
that the console app can resolve the physical path (IMO no clear benefit).
It could cause problem in special cases (for example you removed the site
but want to do a last process on those files with your console application,
resolving the path will become impossible once the web site is removed).

My personal preference would be just to put the full path in the application
configuration file (my logic is that this is a console application that
doesn't have to know what a web site is, its job is just to process files
stored at a given filesystem location).

--
Patrice

"Dots" <myemail@xxxxxxxxx> a écrit dans le message de news:
C33A2CF7-4E70-48C0-BD48-336668FB8CB4@xxxxxxxxxxxxxxxx
To explain better, there is a path that my web application writes to and I
want
to use the same path for my console application to dump files.

The console application is not called by the web application. Actually,
forget about the web application right now.

The path will always be the same
"C:\Inetpub\wwwroot\Web_mycontrol\my_Files_dir\"
No changes at all.

I just want my console application to use a method in my class library
called
getpath() to grab the path and dump files in the my_files_dir folder.

right now I have an app.config file with my console application which is
this

<appSettings>
<add key ="ResultFileLocation" value ="/Web_mycontrol" />
</appSettings>

and at the begining of my getpath() method I have this
FileLocation = AppSettings("ResultFileLocation")

Is this clear enough? Any clue?

--
Dotty


"Patrice" wrote:

Not really clear... For now my understanding is that you want to get the
path of the web application (but is this always
Web_mycontrol\my_Files_dir
under the web root) from a console application ?

What is your architecture ? If the console application is called by the
web
application you could perhaps pass the path as a command line
parameter...

If not, the simplest/more flexible could be to just use the application
config file to define this setting once for all.

--
Patrice

"Dots" <myemail@xxxxxxxxx> a écrit dans le message de news:
0F8F8C09-E644-474D-A61A-7ABDDA838F5B@xxxxxxxxxxxxxxxx
I have a class library with a method called getpath(). I want to be able
to
get
the full path of a folder and write some files to the (my_files_dir)
folder. A console application
will use this class library. How can I do this so I wont have to
hardcode
this path
in my getpath() method. Here is the path below.

"C:\Inetpub\wwwroot\Web_mycontrol\my_Files_dir\"
--
Dotty





.



Relevant Pages

  • Re: Receiving HTTP error 403 opening console
    ... The problem may be related to changes to this default web site or this web ... 222531 Troubleshooting SBS Console Problems ... 226331 Reinstalling the Small Business Server Console ... > This error can be caused if you try to execute a CGI, ...
    (microsoft.public.windows.server.sbs)
  • Re: Early demand for Xbox 360 enormous, retailers report
    ... >>> Early demand for Xbox 360 enormous, retailers report ... >>> consumer demand for Microsoft Corp.'s Xbox 360 video game console. ... >>> retailer reported on its Web site. ...
    (alt.games.video.xbox)
  • RE: Getting settings values in an assermbly library from an ASP.NET or Winform
    ... on my side using a simple web site and a simple console application. ... please "Reply to Group" via your newsreader so ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Getting settings values in an assermbly library from an ASP.NET or Winform
    ... de news: 0algZ06PHHA.2024@xxxxxxxxxxxxxxxxxxxxxxxxx ... on my side using a simple web site and a simple console application. ... This posting is provided "AS IS" with no warranties, and confers no ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Record of sent faxes
    ... printers and faxes, you will open the fax console where you will find what ... Word MVP web site http://word.mvps.org ...
    (microsoft.public.word.mailmerge.fields)