Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. network share code

network share code

Scheduled Pinned Locked Moved Visual Basic
questioncsharpsysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LokmanHakim
    wrote on last edited by
    #1

    Hi, How can I create a network share using .net code? I've search every forum and articles that i can find on the internet but still didn't came to any solution that suited for me. I'm creating a simple application that create a folder and share the folder to the network and unshare the previous folder with the same network sharename

    D 1 Reply Last reply
    0
    • L LokmanHakim

      Hi, How can I create a network share using .net code? I've search every forum and articles that i can find on the internet but still didn't came to any solution that suited for me. I'm creating a simple application that create a folder and share the folder to the network and unshare the previous folder with the same network sharename

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There is nothing in the .NET Base Class Library that will do this. You need to either P/Invoke the appropriate Win32 API functions to setup the Share and appropriate rights or you can do it using WMI and the System.Management namespace. I don't have any code to share with you because I've never had to do it. You could look at this[^] WSH scripting, using WMI, that does approximately what you want. You could use this as a template to create your own code in VB.NET. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      L 1 Reply Last reply
      0
      • D Dave Kreskowiak

        There is nothing in the .NET Base Class Library that will do this. You need to either P/Invoke the appropriate Win32 API functions to setup the Share and appropriate rights or you can do it using WMI and the System.Management namespace. I don't have any code to share with you because I've never had to do it. You could look at this[^] WSH scripting, using WMI, that does approximately what you want. You could use this as a template to create your own code in VB.NET. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        L Offline
        L Offline
        LokmanHakim
        wrote on last edited by
        #3

        Thanks for the link. I'll try the script...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups