![]() |
|
|
|
#1 |
|
Guest
Posts: n/a
|
Getting application location!
Hi,
I have a program sitting in the network, when I double click the program, first thing I want to do is find the application execution path. I am using the following code Assembly execAssembly = System.Reflection.Assembly.GetExecutingAssembly(); string path = Path.GetPathRoot(execAssembly.Location); When I run I get security execption on the execAssembly.Location Does anyone know how to resolve this problem? Thanks. |
|
|
#2 |
|
Guest
Posts: n/a
|
RE: Getting application location!
You already have the path to the assembly in "execAssembly.Location". If you
call Path.GetPathRoot on that, it's going to give you the root of the drive. If you are doing this to a remote machine, you will have a permissions issue by default. You'll need to adjust security to fix that. One way to do it is to use the Control Panel .NET Configuration wizards and grant "full trust" on the remote assembly. --Peter Recursion: see Recursion site: http://www.eggheadcafe.com unBlog: http://petesbloggerama.blogspot.com BlogMetaFinder: http://www.blogmetafinder.com "DBC User" wrote: > Hi, > > I have a program sitting in the network, when I double click the > program, first thing I want to do is find the application execution > path. I am using the following code > > Assembly execAssembly = > System.Reflection.Assembly.GetExecutingAssembly(); > string path = Path.GetPathRoot(execAssembly.Location); > > When I run I get security execption on the execAssembly.Location > > Does anyone know how to resolve this problem? > > Thanks. > > |
| Thread Tools | |
| Display Modes | |
|
|
< Home - Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |