473,327 Members | 1,967 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,327 software developers and data experts.

Check permission on files and directories

Hi!

I need to check if the current user has READ access on a file or a
directory.

Is there a way to do this in C#?, without using try & catch.

/Jonas
Nov 17 '05 #1
2 963
Take a look at the FileIOPermission class. You need to
use Imperative Code Access Security.

Mike Hanson
MCSE, MCSD, MCDBA, MCT
-----Original Message-----
Hi!

I need to check if the current user has READ access on a file or adirectory.

Is there a way to do this in C#?, without using try & catch.
/Jonas
.

Nov 17 '05 #2
I can't find out how to get a specific permission for a file,

/Jonas

"Mike Hanson" <mi************@vodafone.net> wrote in message
news:0b****************************@phx.gbl...
Take a look at the FileIOPermission class. You need to
use Imperative Code Access Security.

Mike Hanson
MCSE, MCSD, MCDBA, MCT
-----Original Message-----
Hi!

I need to check if the current user has READ access on a

file or a
directory.

Is there a way to do this in C#?, without using try &

catch.

/Jonas
.

Nov 17 '05 #3

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

Similar topics

18
by: Dino | last post by:
dear all, i've created an application for a customer where the customer can upload ..csv-files into a specified ftp-directory. on the server, a php-script, triggered by a cronjob, reads all the...
2
by: Aienthiwan | last post by:
Ok - this one's a baffling one. I have a Python script run in cgi, it accesses a directory... /var/foo. The permissions on /var/foo are 770 with an ownership of mark:dbtest. The permissions...
9
by: Maciej Sobczak | last post by:
Hi, I have a string. This string is to be used as a path for a new file. I would like to check if this string *could be* a valid file name, *before* I try to create the file itself. In other...
2
by: David | last post by:
I'm using following code for checking a file existence. I's working fine for given folder. Is there a way to check a file exitance in subfolders? Thanks in advance, David Option Compare...
19
by: wetherbean | last post by:
Hi group..I am writing a playlist management protocol where I have a file that holds all the playlists and a file that holds all the songs....before a playlist is created I need to check to see if...
2
by: Chen Zhuo | last post by:
Hi, I need to write some code to test whether a folder has read/write permission. The idea is to try to read sub-directories in this folder, if succeed, then test whether it's read-only. Any...
7
by: Ajit | last post by:
Is there anyway to check for existance of a file on different machine. i.e. we have a data file (text file) thats stored on some other machine as its not to be exposed in case the web server is...
2
by: Ed Eichman | last post by:
Hi Guys, When I create an ASP.NET web app, which files do I need to check into my version control? I assume that the "bin" directory is skipped, but I'm not sure about the hidden directories...
2
by: vishaltomar | last post by:
Hi, I post this question at a time when my neck is on the line. i have a problem in getting the directory permission using the -w operator. i need to get the permission before I run the xcopy...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.