473,503 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the equivalent of API WNetAddConnection2 in C#?

Hi,

We know that windows API WNetAddConnection2 can make a connection to a
network resource. but how to do this job in C#? i'm wondering about it.

Thanks
-Zhilin
Oct 19 '06 #1
1 5022

"CAIBird" <CA*****@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
| Hi,
|
| We know that windows API WNetAddConnection2 can make a connection to a
| network resource. but how to do this job in C#? i'm wondering about it.
|
| Thanks
| -Zhilin

By PInvoking WNetAddConnection2, the framework has no managed equivalent.
Note that there is (almost) no reason to make a connection to a shared
resource, learn to use UNC paths when accessing shared files.

Willy.
Oct 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

86
7679
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
0
1921
by: Chris Powell | last post by:
Does anyone know if there is an equivalant call or method for the WIN32 API call WNetAddConnection2 to map network drives If not I assume a can import the dll and use it directly ok Thanks,...
1
7959
by: Scott Kay | last post by:
I would please like some help solving an annoying problem with the use Win32 API WNetAddConnection2 from VB.Net 2003, a Windows XP client, and Windows 2003 Web Server server. The client is on...
7
2997
by: ben | last post by:
hello, an algorithm book i'm reading talks about the connectivity problem/algorithm. it gives a number of examples where the connectivity problem applies to real life situations (like, the...
11
1844
by: JS | last post by:
In K&R I have found this: static char allocbuf; static char *allocp = allocbuf; But *allocp has not been set to point at anything yet so how is it possible to make the contents of an unknown...
1
21261
by: Mike D Sutton | last post by:
I'm in the process of porting a bunch of code to C# which for the most part is going well, but just can't seem to get this one to work properly.. Here's the code I'm currently using: *** ...
2
2643
by: John M. Gamble | last post by:
I'm getting this message in Visual Studio 2005: PInvokeStackImbalance was detected Message: A call to PInvoke function 'Refresh!Refresh.Main::WNetAddConnection2' has unbalanced the stack. ...
28
3774
by: gnuist006 | last post by:
I have some code like this: (if (test) (exit) (do something)) or (if (test)
1
4006
by: Chimerique | last post by:
Hello there, here my first post ^^ I'm developping a web application that sometimes acces a shared drive not in the Domain with a local machine logon/password. For that I'm using some code...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.