NET View in C#

G

Guest

Knows somebody how to do a 'NET VIEW' with the .Net framework / ASP.NET?

Using WMI? Capturing DOS output? Or are there any useful classes?

thanks
Eric
 
N

Nicholas Paldino [.NET/C# MVP]

Eric,

I don't think that you can use WMI here, as WMI is only going to give
you the domain that the current machine is a part of. There might be a WMI
query you could execute against the domain controller for this, but I am not
sure.

You can call the API function WNetEnumResource API function in order to
do this.
 
W

Walter Wang [MSFT]

Hi Eric,

The NET VIEW command can be simulated using API WNetOpenEnum and
WNetEnumerateResource; here's an example in C#:

#Enumerating Network Resources - The Code Project - C# Programming
http://www.codeproject.com/csharp/csenumnetworkresources.asp


Hope this helps.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
N

Nicholas Paldino [.NET/C# MVP]

I would say that this example could be improved upon greatly using C#
2.0, as you could use the new iterator syntax to actually yield the resource
when asked for as opposed to loading the whole thing in memory at once.
 
W

Walter Wang [MSFT]

Hi Eric,

I'm wondering if you've seen above replies.

Please feel free to let us know if there's anything unclear. Thanks.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top