How to get current project path from silverlight page?
-
Hi all, I have a silverlight project folder and need to refer an file inside a folder(named as "MyFolder") which is at the same level of the silverlight projec, but not inside the solution. I want to get the path for that folder so that I can access the contents of "MyFolder"? I have tried :
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
but its giving me "Access denied exception" I want to do it from xaml.cs file.... Can anybody know how to get the project path so that I can access the "MyFolder"? Thanks in advance,
-
Hi all, I have a silverlight project folder and need to refer an file inside a folder(named as "MyFolder") which is at the same level of the silverlight projec, but not inside the solution. I want to get the path for that folder so that I can access the contents of "MyFolder"? I have tried :
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
but its giving me "Access denied exception" I want to do it from xaml.cs file.... Can anybody know how to get the project path so that I can access the "MyFolder"? Thanks in advance,
-
hi Salon, try this... :) Hope it works for u, if your folder resides on sever Uri uri1 = new Uri(Application.current.host.sources,"../FolderPath/Nameoffile"); Regards Samir Satardekar
-
Thanks for Quick Reply, I want physical path ....like "C:/Documents/MyDocuments/" in a string variable i do not want localhost path.........
salon wrote:
I want physical path ....like "C:/Documents/MyDocuments/" in a string variable i do not want localhost path.........
Silverlight runs on the client end - it has no knowledge of absolute physical paths on what I'm assuming is your server. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
salon wrote:
I want physical path ....like "C:/Documents/MyDocuments/" in a string variable i do not want localhost path.........
Silverlight runs on the client end - it has no knowledge of absolute physical paths on what I'm assuming is your server. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hi salon, Can you tell about your solution for this problem? Thanks & Best Regards,
-
hi salon how do you solved your problem of fetching the local path. I ran into an issue while implementing BITS, the problem is while creating a job in BITS we have to send the local path (physical path like c:/doc/sample.txt) but Silverlight will not give us the physical path or fullpath. It says access denied. How to get the physical path or fullpath of the file in silverlight? Thanks Nitin C.N