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. C#
  4. Access Network through asp.net 2.0 application

Access Network through asp.net 2.0 application

Scheduled Pinned Locked Moved C#
helpcsharpasp-netsysadminwindows-admin
2 Posts 2 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.
  • A Offline
    A Offline
    abhinish
    wrote on last edited by
    #1

    hi guys! need some help. i need to access files from my local network through an Asp.net Application on win2k3 IIS 6. i tried to open the file through filestream but it gives an Access Denied error . i tried this: string ActualPath = "\\\\192.168.0.26\\c$\program files\abc\abc.exe" FileStream file = new FileStream(ActualPath, FileMode.Open, FileAccess.Read); but it thows an unauthroized access exception.. but when i try to run this code on XP with iis 5 . it works fine . cant figure it out wtz the problem.

    abhinav

    N 1 Reply Last reply
    0
    • A abhinish

      hi guys! need some help. i need to access files from my local network through an Asp.net Application on win2k3 IIS 6. i tried to open the file through filestream but it gives an Access Denied error . i tried this: string ActualPath = "\\\\192.168.0.26\\c$\program files\abc\abc.exe" FileStream file = new FileStream(ActualPath, FileMode.Open, FileAccess.Read); but it thows an unauthroized access exception.. but when i try to run this code on XP with iis 5 . it works fine . cant figure it out wtz the problem.

      abhinav

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      The cause is that IIS 6 is more secure (relatively) and won't allow access like this. You could play around with impersonation however in the end it is not a good idea to allow access to files or application through a webpage. There has been a great deal of effort to lock down and protect systems from hacks, viruses and miscredents.


      only two letters away from being an asset

      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