file access question in c# dll

  • Thread starter Thread starter jason
  • Start date Start date
J

jason

saw another thread on this topic, but no solutions were presented, so
here is my question:

i have a c# class library dll that must access a config-like text file.
when using the FileStream constructor, it seems to attempt to open the
file from the directory that the parent process (the one utilizing the
class library) is running from.

in this case it is a classic ASP application, so it is trying to find
the config file in the SYSTEM32 directory.

is there any way for the class library i wrote to access a text file in
it's OWN directory, whereever that might happen to be? instead of
looking in the directory of the parent process?

thanks for any help,

jason
 
You can use a static write only property to set current working folder. And
at the begining of your application you can set it.

public class SomeClass
{
private string path;
public static WorkingPath
{
set
{
path=value;
}
}
}
 
Back
Top