.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

convert Application.Path from VBA to .net

4 REPLIES 4
Reply
Message 1 of 5
wesbird
260 Views, 4 Replies

convert Application.Path from VBA to .net

Hi,
I am convert one of my project from VBA to .net (C#). now I have problem to convert
Application.Path
to C#. I look everywhere but I can not find it. Should I have to look in Reflection ?

I really appreciate your help

Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
4 REPLIES 4
Message 2 of 5
jbooth
in reply to: wesbird

What you are probably looking for is in the System.Windows.Forms namespace:

System.Windows.Forms.Application.StartupPath
Message 3 of 5
Anonymous
in reply to: wesbird

string sdllPath =
System.Reflection.Assembly.GetExecutingAssembly().Location;

wrote in message news:5092626@discussion.autodesk.com...
Hi,
I am convert one of my project from VBA to .net (C#). now I have problem
to convert
Application.Path
to C#. I look everywhere but I can not find it. Should I have to look in
Reflection ?

I really appreciate your help

Wes
Message 4 of 5
Anonymous
in reply to: wesbird

Using System.Diagnostics;
Using System.IO;


{
string filename = Process.GetCurrentProcess().MainModule.FileName;
string path = Path.GetDirectoryName(filename);
}


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:5092626@discussion.autodesk.com...
Hi,
I am convert one of my project from VBA to .net (C#). now I have problem to convert
Application.Path
to C#. I look everywhere but I can not find it. Should I have to look in Reflection ?

I really appreciate your help

Wes
Message 5 of 5
wesbird
in reply to: wesbird

Thank Jason, Mark and Tony.
I tried all your code. Jason's and Tony's get exact what I want, like C:\Program Files\AutoCAD 2006
Mark's return the path of current dll file.



thank you all again.
Wes
Windows 10 64 bit, AutoCAD (ACA, Map) 2023

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost