user directory

Y

Yael

How to cheack the path of a directory I'm running?
I want to read in my com add-in from a txt file:
MatarotData.txt

StreamReader("C:\\MatarotToolbar\\MatarotData.txt");

in JAVA:
System.getProperty("user.dir");
 
J

John

I'm not sure what language you're writing it in, but in vb.net it's simply

Directory.GetCurrentDirectory()

For the parent directory use

Directory.GetParentDirectory()


Hope this helps :) (remember to import System.io)
 
Y

Yael

In C# I get:
Directory.GetCurrentDirectory()
string path = "C:\Program Files\Common Files\SYSTEM\MSMAPI\1037"

but in my build in code my file in:
"C:\\MatarotToolbar\\MatarotData.txt"
 
J

John

It's the same :)

Directory.GetCurrentDirectory();

instead of imports, use "Using System.IO;"
 
K

Ken Slovak - [MVP - Outlook]

I usually use something like:

string path = Assembly.GetExecutingAssembly().CodeBase
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top