Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 4th, 2005, 05:33 AM
Authorized User
 
Join Date: Dec 2004
Location: Salo, Loimaa, , Finland.
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to eelisMX
Default Security permissions of file

Hi

I'm trying to check a file for its security permissions to determine if it is writeable or not.
The code looks like that:
Code:
Function IsFileWritePermission(ByVal sFileName As String) As Boolean
        Try
            Dim fp As FileIOPermission
            fp = New FileIOPermission(FileIOPermissionAccess.Write, sFileName)

            fp.Demand()

            Return True
        Catch ex As Security.SecurityException
            Return False
        Catch ex As Exception
            Return False
        End Try
    End Function
The file i'm testing has a Deny Write permission and the function still return true. If I try to open the file to write, it raises an error exception for write permission.

Thanks.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File permissions windows 2000 rasheed.akr ASP.NET 1.0 and 1.1 Professional 0 September 15th, 2008 01:45 AM
Permissions on DB without user-level security nbourre Access VBA 4 June 7th, 2008 08:09 AM
Network File Permissions Pope ASP.NET 1.0 and 1.1 Professional 2 January 12th, 2006 12:42 PM
System.Security.Permissions.SecurityPermission jshae VB.NET 2002/2003 Basics 6 November 4th, 2004 02:16 AM
File Permissions rwalker ASP.NET 1.0 and 1.1 Basics 5 April 20th, 2004 12:29 PM



All times are GMT -4. The time now is 08:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.