Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / November 2004

Tip: Looking for answers? Try searching our database.

Open file requiring username/password

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Thielen - 02 Nov 2004 00:51 GMT
Hi;

How can I open a file that requires a username & password for access?

thanks - dave

Signature

thanks - dave

"Peter Huang" - 03 Nov 2004 08:29 GMT
Hi

Can you specified the problem more detailed?
What is the file type?
an excel file(.xls) or a word file(.doc) or else?

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

David Thielen - 03 Nov 2004 16:43 GMT
Hello;

The short answer is numerous (any) file types.

This is for something that is like a version control system and in many
cases the files are on another server (sometimes Windows, sometimes unix)
where we need to be able to read the files from the server and write new
copies of the files to the server.

In some cases, the windows user does not have rights to the share the file
is on. But they do know a username/password that will give them rights to the
file. So we need to be able to pass the username/password to use to access
the file when we open it.

thanks - dave

> Hi
>
[quoted text clipped - 9 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" - 04 Nov 2004 02:51 GMT
Hi

I think what you need to impersonate the user which has the right to access
the network shared folder.
You may try to impersonate the user which has the right with code sample in
the link below to see if that is what you want.
WindowsImpersonationContext Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemsecurityprincipalwindowsimpersonationcontextclasstopic.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

David Thielen - 04 Nov 2004 03:05 GMT
Hello;

That looks like it does what I need. However, it worries me a little because:
1) It uses unmanaged code.
2) It say sthe example will run on XP but not on 2000 (and I assume 2003)
because it is a security risk.

Is there any way to do this using just managed code and that is not
considered a security risk?

And if this is the only way, is there a url that explains what has to be
changed in the windows 2000/2003 security policy to allow this to run?

thanks - dave

> Hi
>
[quoted text clipped - 13 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" - 05 Nov 2004 03:06 GMT
Hi,

The logonuser will work fine on windows xp and later including 2003. To run
the logonuser on windows 2000 we need to give the user that that run the
logonuser the SE_TCB_NAME(in User Manager, this is the "Act as part of the
Operating System" right) If we give the common user the right, the common
user will have the "Act as part of the Operating System" right.

Another way is to use the runas service. We can start a new process which
use the runas.exe to start a new process under certain user account. A
common user can use the runas.exe to do the impersonate on windows 2000.
For how to use runas, you may try to run the runas in the commmand prompt
to see the help.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Huang" - 10 Nov 2004 09:40 GMT
Hi,

If you have any more concerns on it, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.