Re: C# connection and file access question
- From: "Nick Malik [Microsoft]" <nickmalik@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Mar 2006 01:04:36 -0800
Yes, assuming that the machine you are accessing the files FROM is on the
same domain as the machine with the files. If this is so, then impersonate
the user that has permissions, and simply open the file using the UNC
notation in the prior response.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Jason Huang" <JasonHuang8888@xxxxxxxxxxx> wrote in message
news:eHirg1ASGHA.196@xxxxxxxxxxxxxxxxxxxxxxx
Thanks Nick.
But is it possible for using the C# code to get into the Windows XP
folders and access the files? given that we know the Account and
Password?
Thanks for help.
Jason
"Nick Malik [Microsoft]" <nickmalik@xxxxxxxxxxxxxxxxxx>
¼¶¼g©ó¶l¥ó·s»D:jYadnY6pO8mwU4rZnZ2dnUVZ_vidnZ2d@xxxxxxxxxxxxxx
The windows file system allows file sharing under the control of the
machine's owner. Windows XP does not normally allow external access to
the files on that machine.
However, file sharing is enabled, and if you have permissions to the
machine (in other words, if you are listed in the Local Users or Local
Administrators group on that machine) then you can access files on the C
drive as:
"\\MachineName\C$\mydirectory\myfile" using normal methods for opening,
reading, and writing files (instead of SQL connect strings).
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Jason Huang" <JasonHuang8888@xxxxxxxxxxx> wrote in message
news:uMuem2$RGHA.2088@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
In C# the SqlConnection=
"data
source=192.168.100.100;uid=MyID;password=MyPwd;database=ETCserviceTest
";
and it is for SQL data connection.
Do we have some similiar method for accessing files in a paticular
Windows XP machine?
Thanks for help.
Jason
.
- References:
- C# connection and file access question
- From: Jason Huang
- Re: C# connection and file access question
- From: Nick Malik [Microsoft]
- Re: C# connection and file access question
- From: Jason Huang
- C# connection and file access question
- Prev by Date: whats is parkingwindow??
- Next by Date: Re: Working with oracle!
- Previous by thread: Re: C# connection and file access question
- Next by thread: random access to elements of a disk-based XML file
- Index(es):
Relevant Pages
|