Results 1 to 5 of 5

Thread: Visual Basic 2008 share a folder

  1. #1
    JD2369 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 1.1
    Join Date
    Jan 2011
    Posts
    19
    Reputation
    31

    Visual Basic 2008 share a folder

    I have the code to create a folder, does anyone have the code to share the folder and set the permission for everyone to have full control?

    Thank You

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,206
    Reputation
    2369
    Code:
    Dim info As New ProcessStartInfo("net", "share test=d:\testshare /grant:everyone,full")
    With info
        .RedirectStandardOutput = True
        .UseShellExecute = False
        .CreateNoWindow = True
    End With
    Dim proc As Process = Process.Start(info)
    Me.ResultTextBox.Text = proc.StandardOutput.ReadToEnd
    proc.Dispose()

  3. #3
    JD2369 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 1.1
    Join Date
    Jan 2011
    Posts
    19
    Reputation
    31
    THank you, how can i link that to a textbox? whatever is typed into textbox1 is shared?

  4. #4
    JD2369 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 1.1
    Join Date
    Jan 2011
    Posts
    19
    Reputation
    31
    textbox1 = please enter in foldername
    button1 = share folder

  5. #5
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,206
    Reputation
    2369
    I'd use the FolderBrowserDialog (add to form from Toolbox). Doubleclick the Button in designer to get to the Click event handler and write your code there. You'd call the dialog.ShowDialog and retrieve the SelectedPath property value and use that as input to the String expression. Give it a go.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking