where are the network classes in .NET?

G

giddy

hi ,

I'm really confused about where microsoft programmers have put the
network classes?

I've been looking for classes in .NET that can enumerate/set etc
network shares , file sharing etc... for months now.

I know that the WNetEnumOpen , and its family of API are the win32 way
to go. but there should be a .NET class for this right??

But i've seen a lot of people mention a number of classes ,
System.NET , which does'nt encapsulate the WNet API , also
System.Management? since i searched for setting file sharing.

So is there a class that i'm missing? that would enum netowork shares
and set file sharing or is .NET missing it??

Gideon
 
M

Michael Nemtsev

Hello giddy,

Not all WinAPI methods exist in .NET, so there is a common practice to use
API calls.
So, if u found nothing in managed classes just use WinAPI

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

g> hi ,
g>
g> I'm really confused about where microsoft programmers have put the
g> network classes?
g>
g> I've been looking for classes in .NET that can enumerate/set etc
g> network shares , file sharing etc... for months now.
g>
g> I know that the WNetEnumOpen , and its family of API are the win32
g> way to go. but there should be a .NET class for this right??
g>
g> But i've seen a lot of people mention a number of classes ,
g> System.NET , which does'nt encapsulate the WNet API , also
g> System.Management? since i searched for setting file sharing.
g>
g> So is there a class that i'm missing? that would enum netowork shares
g> and set file sharing or is .NET missing it??
g>
g> Gideon
g>
 
P

-pb-

Try using System.Management namespace to get all information you want
using unmanaged WMI service provided by Microsoft. You can also try
System.DirectoryService but I am not sure whether you can use it apart
from getting the user information from AD Server
 
G

giddy

hmm. . i've got three sets of code , one uses p/Invoked win32API ,
another uses directoryEntry? and another uses some IPConnection
class , only the win32 code seems to work on my pc.

It seems there are NetXXX API for setting sharing/privileges and
everything. just wonder why microsoft has'nt added this into .NET?

Well , i'm off to the MSDN win32API pages and probably the win32
newsgroups too.

Gideon
 
G

giddy

hmm. . i've got three sets of code , one uses p/Invoked win32API ,
another uses directoryEntry? and another uses some IPConnection
class , only the win32 code seems to work on my pc.

It seems there are NetXXX API for setting sharing/privileges and
everything. just wonder why microsoft has'nt added this into .NET?

Well , i'm off to the MSDN win32API pages and probably the win32
newsgroups too.

Gideon
 

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