473,395 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Connect as...

Lee
I need to programtically connect to a network resource such as a file share,
but need to provide alternate credentials, like mapping a drive under a
different user name. How can I do this in VB.NET?
Oct 6 '05 #1
4 1398
From which kind of application ?

Try perhaps :
http://support.microsoft.com/default...22120121120120

--
Patrice

"Lee" <Le*@discussions.microsoft.com> a écrit dans le message de
news:F9**********************************@microsof t.com...
I need to programtically connect to a network resource such as a file share, but need to provide alternate credentials, like mapping a drive under a
different user name. How can I do this in VB.NET?

Oct 6 '05 #2
Lee
windows forms.
Oct 6 '05 #3
One option is to P/Invoke WNetAddConnection2() API. A sample can be found
here: http://www.pinvoke.net/default.aspx/...nnection2.html

Other way is to shell "net use" command. For help on the command-line
parameters, type "net help use".

"Lee" wrote:
I need to programtically connect to a network resource such as a file share,
but need to provide alternate credentials, like mapping a drive under a
different user name. How can I do this in VB.NET?

Oct 6 '05 #4
Lee
The WnetAddConnection2 is the way I was proceeding, but alas I was hoping
there was a pure .NET way to do it. I guess .NET still has a ways to go.
Oct 6 '05 #5

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

Similar topics

22
by: James Kupernik | last post by:
Hello everyone! I'm hoping someone can shed some light on my ever daunting mysql/php problem. I'm currently trying to get a new server up and running using apache/php/mysql. Everything runs...
4
by: Steve Smith | last post by:
I have just installed db2 connect v8.1 (personal edition) on my PC - and reinstalled DB2 Application development client (again v8.1 FP4). When trying to use this to connect via CLI to an AS/400...
6
by: Jerry Orr | last post by:
We are trying to determine the easiest (and cheapest) way to get connections for about 50 Win2K workstations on our LAN to DB2 on a z/OS server. We could install DB2 Connect Personal Edition on...
30
by: aka | last post by:
Hi I have a DB2 v8.1 on AIX and DB2 Connect EE on Solaris wich is connected to OS/390 DB2 subsystems via APPC / SNA. I have cataloged the DB2 Connect instance as tcpip node and then the Host DB...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
5
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
5
by: rAinDeEr | last post by:
Hi, Y'day one of my friend showed me how to connect to a Oracle database as SYSDBA, DBA etc I have DB2 UDB installed in Linux machine.Right now, I have a user WADI which has got some...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
2
by: zgh1970 | last post by:
Hi, All, I have question on DB2 CONNECT configure. We installed DB2 ESE V8 FixPak 14 o AIX . When we set up the connection to DB2 Mainframe. We just catalog node and DB directory without DCS....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...

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.