How to make code run differently depending on the platform it is running on?
xarzu - Apr 05 2019 09:17 AM
How do I set a breakpoint in an attached process in visual studio
xarzu - Apr 04 2019 11:47 AM
Recent Blog Entries
Recent Status Updates
- Managed C++
- Visual Basic 4 / 5 / 6
- linked list
- hello world
Populate tree view with remote computer directoriestreeview tcpclient directory populate remote treenode
Posted 19 November 2012 - 09:46 AM
Dose anyone have any solutions ?
The method i apropched is that on the server side i made that when i send the string "DirectoryInfo path" the server launches DirectoryInfo mypath returns the folders in a string and sends them back using NetworkStream, then i read the stream an add them to the treevies using a very raw and ** method ex:
TreeNode hdd1 = new TreeNode(@"C:\");
string folder =Regex.Split("return string from netStream", "\r\n");
foreach (string fd in folder)
and that is how i get the first folders in "C:\", as you can see it is a primitive method, any ideas on how can i do this cleaner ? or how to get the next subfolders and so on, or at least improve my code?
Thanks in advance.
Posted 20 November 2012 - 12:56 AM
about your code, the c: will be a problem, since most of computers has many disc units and usually c: is only for programs and installations.
If you want to open the sub-directory's branches you are going to need a recursive method that splits the path by \
Posted 23 November 2012 - 09:09 AM
I add directories to a TreeNode then use BinaryFormatter to serialize it and on the reciveing side the BinaryFormatter to deserialize it and add it to the TreeView