Click here to Skip to main content
15,921,542 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGet path Pin
p_196010-Apr-09 23:46
p_196010-Apr-09 23:46 
AnswerRe: Get path Pin
Henry Minute11-Apr-09 2:47
Henry Minute11-Apr-09 2:47 
AnswerRe: Get path Pin
Dave Kreskowiak11-Apr-09 6:58
mveDave Kreskowiak11-Apr-09 6:58 
Questionproblem in updating database [modified] Pin
rajulama10-Apr-09 21:17
rajulama10-Apr-09 21:17 
AnswerRe: problem in updating database Pin
Mycroft Holmes10-Apr-09 22:37
professionalMycroft Holmes10-Apr-09 22:37 
GeneralRe: problem in updating database Pin
rajulama10-Apr-09 23:07
rajulama10-Apr-09 23:07 
GeneralRe: problem in updating database Pin
Dave Kreskowiak11-Apr-09 6:56
mveDave Kreskowiak11-Apr-09 6:56 
QuestionHow do I set permissions for delete or move a file from external drive in Vista Pin
x38class10-Apr-09 21:00
x38class10-Apr-09 21:00 
I have an app that needs to delete a file or move it from an external drive

My app works fine in XP but fails in Vista because permissions are not set

I have tracked down the following but some properties are not correct for vb,net 2005 with net framework 2.0

## copied source details:
For those interested I have found a way to allow the permissions I set to be inherited for the folder/directory in question and all subfolders and files.

Apparently you must add a rule for each condition folder, folder objects and the container

Below is the additions:

Public Sub AddSecurityAttribute()
Dim directoryInfo As New DirectoryInfo(Me.FolderName)
Dim directorySecurity As AccessControl.DirectorySecurity = directoryInfo.GetAccessControl
' Add Security to This Folder, Subfolders and Files
' Must include an access rule for each condition
directorySecurity.AddAccessRule(New AccessControl.FileSystemAccessRule(Me.UserAccount, Me.FileRights, AccessControl.InheritanceFlags.ObjectInherit, AccessControl.PropagationFlags.InheritOnly, Me.ControlType))

directorySecurity.AddAccessRule(New AccessControl.FileSystemAccessRule(Me.UserAccount, Me.FileRights, AccessControl.InheritanceFlags.ContainerInherit, AccessControl.PropagationFlags.InheritOnly, Me.ControlType))

directorySecurity.AddAccessRule(New AccessControl.FileSystemAccessRule(Me.UserAccount, Me.FileRights, Me.ControlType))

directoryInfo.SetAccessControl(directorySecurity)
End Sub

Remember this is VB.NET 2.0 code, the AccessControl Class is new to the 2.0 framework.

any help much appreciated
AnswerRe: How do I set permissions for delete or move a file from external drive in Vista Pin
Anubhava Dimri10-Apr-09 21:22
Anubhava Dimri10-Apr-09 21:22 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
x38class10-Apr-09 23:02
x38class10-Apr-09 23:02 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
Anubhava Dimri10-Apr-09 23:15
Anubhava Dimri10-Apr-09 23:15 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
x38class11-Apr-09 20:37
x38class11-Apr-09 20:37 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
Anubhava Dimri12-Apr-09 18:06
Anubhava Dimri12-Apr-09 18:06 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
x38class13-Apr-09 21:01
x38class13-Apr-09 21:01 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
Anubhava Dimri13-Apr-09 21:12
Anubhava Dimri13-Apr-09 21:12 
GeneralRe: How do I set permissions for delete or move a file from external drive in Vista Pin
x38class18-Apr-09 19:10
x38class18-Apr-09 19:10 
QuestionCan you help me code a function procedure in Visual Basic 2008? Pin
Boblc12310-Apr-09 18:36
Boblc12310-Apr-09 18:36 
AnswerRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Dave Kreskowiak10-Apr-09 18:49
mveDave Kreskowiak10-Apr-09 18:49 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Boblc12310-Apr-09 18:56
Boblc12310-Apr-09 18:56 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Wes Aday10-Apr-09 19:13
professionalWes Aday10-Apr-09 19:13 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Dalek Dave10-Apr-09 19:34
professionalDalek Dave10-Apr-09 19:34 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Wes Aday10-Apr-09 19:44
professionalWes Aday10-Apr-09 19:44 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Eddy Vluggen10-Apr-09 23:40
professionalEddy Vluggen10-Apr-09 23:40 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Dave Kreskowiak11-Apr-09 6:44
mveDave Kreskowiak11-Apr-09 6:44 
GeneralRe: Can you help me code a function procedure in Visual Basic 2008? Pin
Boblc12311-Apr-09 7:07
Boblc12311-Apr-09 7:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.