473,386 Members | 1,745 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,386 software developers and data experts.

How to logon to network server via code

I am writing a windows service that needs to logon to a server to import a
file residing on that server. The server is on the local network, but in
the dmz. Not sure is the latter makes any difference, but is there a way to
programmatically logon to that server with proper credentials with VB code?
What's involved? Example?

Thanks in advance,
Dean S
Dec 20 '06 #1
1 1727
Normally you would use the LogonUser function, but knowing that it fails on
Windows 2000 Pro & Server because ACT AS PART AS THE OPERATING SYSTEM is
needed for it to succeed

However, on XP Home/Pro LogonUser is successful, but not sure on Windows
2003.

Here's a little info on using/declaring this function:

http://www.pinvoke.net/default.aspx/...LogonUser.html
http://aspalliance.com/39

That will give you a start

For more infor search MSDN for the LogonUser API in the 2003 SP1 SDK

I hope this helps,

Newbie Coder

"Dean Slindee" <sl*****@charter.netwrote in message
news:pH*************@newsfe04.lga...
I am writing a windows service that needs to logon to a server to import a
file residing on that server. The server is on the local network, but in
the dmz. Not sure is the latter makes any difference, but is there a way
to
programmatically logon to that server with proper credentials with VB
code?
What's involved? Example?

Thanks in advance,
Dean S


Dec 20 '06 #2

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

Similar topics

1
by: cwnewbe1 | last post by:
I would like to be able to add environment symbols to the Microsoft XP registry. I tried the example in the Python Cookbook by Orielly by running the script locally and it worked fine. Although I...
0
by: google | last post by:
My Crystal reports are being supplied the logon credentials via a C# code class that recursively loops through all the tables present in the reports and applies the login credentials (Servername,...
1
by: Ivaylo | last post by:
Hello, Can someone help me in my C# program: I am just trying to deal with files stored on the shared network server- to create, read and write operations. If the user is authenticated from...
3
by: rfontaine | last post by:
I have a virtual directory on IIS 5.0 to a remote share on a Windows 2003 file server. The "connect as" is a domain user account. The share as read permission for everyone and the NTFS permission...
1
by: Ezra | last post by:
Our company's web server is trying to access graphics files on another server. When I run the app from Visual Studio (1.0) on my localhost, the server in question is available (which is accessed a...
0
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to...
8
by: HDI | last post by:
Hi, We are working with Office 2003 and for our access apps we logon with the classic access security. The username and password is the same as windows logon. Is it possible that access check...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
0
by: EricBlair | last post by:
Hello, Wondering if anyone has run across this and has some ideas? This is for C#/.Net VS 2005. I wrote some code that gets to a network login dlg through IE. That's the windows credentials...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.