Create a folder with full Sharing Rights
-
Hi All, I am creating an application in vb.net 2008 and Sql server 2005 I want to create a shared folder in the Server system, Than can be acceasable from all the Other System. And This file using all the User Access Rights. How can I create the Access Rights
Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)
-
Hi All, I am creating an application in vb.net 2008 and Sql server 2005 I want to create a shared folder in the Server system, Than can be acceasable from all the Other System. And This file using all the User Access Rights. How can I create the Access Rights
Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)
Use following code Dim strPath As String = "C:\Gaurav" Dim dir As String = IO.Path.Combine(strPath, "Temps") Dim dirSecurity As New System.Security.AccessControl.DirectorySecurity Dim rul As New Security.AccessControl.FileSystemAccessRule("Everyone", Security.AccessControl.FileSystemRights.FullControl, Security.AccessControl.AccessControlType.Allow) dirSecurity.AddAccessRule(rul) IO.Directory.CreateDirectory(dir, dirSecurity) Dim sharename As String = "ServerFolder" Dim cmdstring As String = "cmd /c net share """ & sharename & """=""" & dir & """" & " /unlimited" Shell(cmdstring)
-
Hi All, I am creating an application in vb.net 2008 and Sql server 2005 I want to create a shared folder in the Server system, Than can be acceasable from all the Other System. And This file using all the User Access Rights. How can I create the Access Rights
Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)
The basic code behind creating a share can be found here[^]. It's in C#, but is easily translatable to VB.NET using any online code conversion tool.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008