473,480 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

file access question in c# dll

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

Nov 17 '05 #1
1 1767
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;
}
}
}

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"jason" <ia****@yahoo.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2786
by: Joe Costa | last post by:
I have written the following code to search for the right file depending on the startup file for "Client Access". The menu database that I made will load the correct config file specific for each...
4
47414
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
4
5507
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
0
3904
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
16
2369
by: Eran.Yasso | last post by:
Hi, I have a mdb file shared in the LAN. I want to write app that verifies if it's open. If the file is not open, then my app can open the file. if the file is used, then the app won't open it....
0
6912
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7092
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6981
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.