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. Web Development
  3. ASP.NET
  4. Reading text file

Reading text file

Scheduled Pinned Locked Moved ASP.NET
helpsysadmintutorialquestion
6 Posts 3 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
    sachees123
    wrote on last edited by
    #1

    Want to read file of mine extension ie. "abc.ba" either from web or from local drive. problem is how to set path of file wat i tried is : fp = File.OpenText(Server.MapPath(("C://Upload//") + "test.RA")); fp = File.OpenText(Server.MapPath(("C:\\Upload\\") + "test.RA")); fp = File.OpenText(Server.MapPath((".\\Upload\\") + "test.RA")); Everytime an error message come "VIRTUAL PATH NOT FOUND" wat to do???

    S B 2 Replies Last reply
    0
    • S sachees123

      Want to read file of mine extension ie. "abc.ba" either from web or from local drive. problem is how to set path of file wat i tried is : fp = File.OpenText(Server.MapPath(("C://Upload//") + "test.RA")); fp = File.OpenText(Server.MapPath(("C:\\Upload\\") + "test.RA")); fp = File.OpenText(Server.MapPath((".\\Upload\\") + "test.RA")); Everytime an error message come "VIRTUAL PATH NOT FOUND" wat to do???

      S Offline
      S Offline
      saanj
      wrote on last edited by
      #2

      Just try to map a virtual directory to the folder and access the virtual directory.

      Either you love IT or leave IT...

      S 1 Reply Last reply
      0
      • S sachees123

        Want to read file of mine extension ie. "abc.ba" either from web or from local drive. problem is how to set path of file wat i tried is : fp = File.OpenText(Server.MapPath(("C://Upload//") + "test.RA")); fp = File.OpenText(Server.MapPath(("C:\\Upload\\") + "test.RA")); fp = File.OpenText(Server.MapPath((".\\Upload\\") + "test.RA")); Everytime an error message come "VIRTUAL PATH NOT FOUND" wat to do???

        B Offline
        B Offline
        Blue_Boy
        wrote on last edited by
        #3

        try

        fp = File.OpenText(Server.MapPath(("~\\Upload\\") + "test.RA"));


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        S 1 Reply Last reply
        0
        • S saanj

          Just try to map a virtual directory to the folder and access the virtual directory.

          Either you love IT or leave IT...

          S Offline
          S Offline
          sachees123
          wrote on last edited by
          #4

          I tried that too but same message.

          1 Reply Last reply
          0
          • B Blue_Boy

            try

            fp = File.OpenText(Server.MapPath(("~\\Upload\\") + "test.RA"));


            I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

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

            message {"Could not find a part of the path 'C:\\Documents and Settings\\SJ\\My Documents\\Visual Studio 2005\\WebSites\\Results\\Upload\\test.ra'."} and my file is at c:\upload\test.ra

            B 1 Reply Last reply
            0
            • S sachees123

              message {"Could not find a part of the path 'C:\\Documents and Settings\\SJ\\My Documents\\Visual Studio 2005\\WebSites\\Results\\Upload\\test.ra'."} and my file is at c:\upload\test.ra

              B Offline
              B Offline
              Blue_Boy
              wrote on last edited by
              #6

              File.OpenText("c:\upload\test.ra"); for more info check this result[^]


              I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

              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