Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. How to get current project path from silverlight page?

How to get current project path from silverlight page?

Scheduled Pinned Locked Moved WPF
wpftutorialquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    salon
    wrote on last edited by
    #1

    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,

    V 1 Reply Last reply
    0
    • S salon

      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,

      V Offline
      V Offline
      VCsamir
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • V VCsamir

        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

        S Offline
        S Offline
        salon
        wrote on last edited by
        #3

        Thanks for Quick Reply, I want physical path ....like "C:/Documents/MyDocuments/" in a string variable i do not want localhost path.........

        M 1 Reply Last reply
        0
        • S salon

          Thanks for Quick Reply, I want physical path ....like "C:/Documents/MyDocuments/" in a string variable i do not want localhost path.........

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          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:

          S 1 Reply Last reply
          0
          • M Mark Salsbery

            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:

            S Offline
            S Offline
            salon
            wrote on last edited by
            #5

            Hi all, Thanks for ur kind and quick support.... My problem is solved....

            M N 2 Replies Last reply
            0
            • S salon

              Hi all, Thanks for ur kind and quick support.... My problem is solved....

              M Offline
              M Offline
              Member 3552712
              wrote on last edited by
              #6

              Hi salon, Can you tell about your solution for this problem? Thanks & Best Regards,

              1 Reply Last reply
              0
              • S salon

                Hi all, Thanks for ur kind and quick support.... My problem is solved....

                N Offline
                N Offline
                nitincn
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups