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. C#
  4. \\computer\shared

\\computer\shared

Scheduled Pinned Locked Moved C#
questionsysadmindata-structurestutorial
5 Posts 3 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
    lustuyck
    wrote on last edited by
    #1

    Hi, I'm developing kind of an explorer-like application, that lists local drives/folders and also network drives, as explorer does. When the user enters a path like C:\folder1\folder2, I can browse the tree to select that tree. However, when the user enters something like \\computername, or \\computername\shared, then how should I browse the tree to select that one? I can't enumerate all domains to check where that computername can be found (takes hours), so what is the correct approch? Can I, for example, check to which domain a computername belongs, or something like that? Kind regards, Ludwig

    H Richard DeemingR 2 Replies Last reply
    0
    • L lustuyck

      Hi, I'm developing kind of an explorer-like application, that lists local drives/folders and also network drives, as explorer does. When the user enters a path like C:\folder1\folder2, I can browse the tree to select that tree. However, when the user enters something like \\computername, or \\computername\shared, then how should I browse the tree to select that one? I can't enumerate all domains to check where that computername can be found (takes hours), so what is the correct approch? Can I, for example, check to which domain a computername belongs, or something like that? Kind regards, Ludwig

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      lustuyck wrote: Can I, for example, check to which domain a computername belongs, or something like that? Yes, you can, but you'll need to P/Invoke NetWkstaGetInfo and declare the WKSTA_INFO_100 structure that goes with it. Lookup this function in the MSDN Library[^] for more information. Windows Explorer does this using ITEMIDs and monikers to get those IDs. Using this information - a namespace, if you will - it can determine a path rather quickly (of course, a shell namespace provider parses the moniker). While it would be possible to use the necessary shell APIs to do this, you're looking at a huge effort to P/Invoke, interop, and declare all the necessary structs and consts to do this in C#. If you take this route, I recommend you create a mixed-mode Managed C++ assembly (i.e., contains both native instructions and IL that can be used by other managed projects). This way you don't have to worry about interop - just use the native methods, include the headers with the pre-proc defs you need, etc., etc.

      Microsoft MVP, Visual C# My Articles

      L 1 Reply Last reply
      0
      • L lustuyck

        Hi, I'm developing kind of an explorer-like application, that lists local drives/folders and also network drives, as explorer does. When the user enters a path like C:\folder1\folder2, I can browse the tree to select that tree. However, when the user enters something like \\computername, or \\computername\shared, then how should I browse the tree to select that one? I can't enumerate all domains to check where that computername can be found (takes hours), so what is the correct approch? Can I, for example, check to which domain a computername belongs, or something like that? Kind regards, Ludwig

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        Have a look at Furty's FolderTreeView[^] control.


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        L 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          Have a look at Furty's FolderTreeView[^] control.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          L Offline
          L Offline
          lustuyck
          wrote on last edited by
          #4

          Thanks, but this does only support drilling to a folder, not to a UNC...

          1 Reply Last reply
          0
          • H Heath Stewart

            lustuyck wrote: Can I, for example, check to which domain a computername belongs, or something like that? Yes, you can, but you'll need to P/Invoke NetWkstaGetInfo and declare the WKSTA_INFO_100 structure that goes with it. Lookup this function in the MSDN Library[^] for more information. Windows Explorer does this using ITEMIDs and monikers to get those IDs. Using this information - a namespace, if you will - it can determine a path rather quickly (of course, a shell namespace provider parses the moniker). While it would be possible to use the necessary shell APIs to do this, you're looking at a huge effort to P/Invoke, interop, and declare all the necessary structs and consts to do this in C#. If you take this route, I recommend you create a mixed-mode Managed C++ assembly (i.e., contains both native instructions and IL that can be used by other managed projects). This way you don't have to worry about interop - just use the native methods, include the headers with the pre-proc defs you need, etc., etc.

            Microsoft MVP, Visual C# My Articles

            L Offline
            L Offline
            lustuyck
            wrote on last edited by
            #5

            Okay, thanks for the answer, I got it working! Kind regards, Ludwig

            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