Re: C# connection and file access question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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







.



Relevant Pages

  • Re: Thoughts on Designing a Wizard
    ... Shall I have an MDI application with child windows, ... slowly (say they have Powerpoint, Visio, and Windows Media Player running as ... I do not answer questions on behalf of my employer. ... programmer helping programmers. ...
    (microsoft.public.dotnet.general)
  • Re: C# connection and file access question
    ... Windows XP does not normally allow external access to ... I do not answer questions on behalf of my employer. ... programmer helping programmers. ... and it is for SQL data connection. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: windows service to lunch windows application
    ... as long as your app is a console application that requires no input and no ... I do not answer questions on behalf of my employer. ... programmer helping programmers. ... > user having to log into the Windows XP machine. ...
    (microsoft.public.dotnet.general)
  • Re: Upd SQL Srvr table with text file
    ... read from one database and write to another. ... I do not answer questions on behalf of my employer. ... > get the data set from the text retrieval into a data set to update the SQL ... >> programmer helping programmers. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: An InvalidCastException again
    ... XML that matches the values that it used. ... I do not answer questions on behalf of my employer. ... >> Fully qualify the mapping class that you want on the line: ... >> programmer helping programmers. ...
    (microsoft.public.dotnet.general)