473,386 Members | 1,654 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Query a Network Share Directory

Hello

I am fairly new to .NET Development. I need to query folders within a
network drive and return some metadata related to the directories.
For instance, I might have the following path: \\MyServer\Tech
I would want to get the size and name of all the folders inside this folder.
I tried using a simple DirectoryInfo object, but I am getting
AccessDeniedException. I know there has to be a better way of doing this
using Impersonation.
Can someone please help?

Hector
Jun 9 '07 #1
1 1692
hecsan07 wrote:
Hello

I am fairly new to .NET Development. I need to query folders within a
network drive and return some metadata related to the directories.
For instance, I might have the following path: \\MyServer\Tech
I would want to get the size and name of all the folders inside this folder.
I tried using a simple DirectoryInfo object, but I am getting
AccessDeniedException. I know there has to be a better way of doing this
using Impersonation.
Can someone please help?
AccessDeniedException means just that. You don't have permissions on the
Share with your user account to access anything on the Share If this
is a Web application and it's VS 2003, then the machine\ASPNET account
must have permissions to access the Share on the machine.

Keep in mind that access permission by user account to folders and files
on the Share is different than user account access permissions to the
Share itself.

You have a user account permissions issue that the application is
running under.

Jun 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Leo R | last post by:
Hi, Is it possible to create a network-drive at the SYSTEM-level? E.g.: map X: to \\server1\share so a windows service can reach X: without having to log on? I want a Windows .NET service to...
23
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the...
1
by: brian.oneil2 | last post by:
Is there a way to install this onto a network file share and allow a team to access it? I would say share a CD from a networked CD drive, but there are multiple CD's that would have to be inserted....
2
by: bryanrite | last post by:
I have been desperately trying to get this to work. I create a C# Web App on the localhost (the only place i'm allowed to put it). Put an arbitrary button or something in, compile it, run it......
4
by: Scott Nicholson | last post by:
I've got a site set up that uses a network share as it's home directory. Simple stuff is working fine. When I try to put a database in there, though, I run into problems. I'm using: dim...
3
by: Miriam | last post by:
Hello, I created a Windows Service in VB.NET, which is to purge files periodically in the local system and also in the shared network drive. Here is my problem: 1. If I set the “Account”...
2
by: Michael | last post by:
We have an ASP.NET 2.0 web application running on a Windows 2003 domain controller. Part of that application needs to read and write files from and to a network share ( living on a MAC Xserveraid)...
0
by: cw808 | last post by:
Hi all. I'm new here but hoping I can get some help for my problem. My situation is that I need to upload files through a C# .NET web application to a file server. I done a search and followed...
3
by: =?Utf-8?B?Q2hyaXN0aWFuIGZyb20gRnJhbmNl?= | last post by:
I want to write an aspnet aspx page This page : 1 - Connect to a net share \\server\c$ with credentials: user/password 2 - Read Directory info of this share 3 - Write these infos in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.