473,503 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading Remote Files

Hi all,

I'm trying to get a full directory listing from a remote machine. Anyone
know how? Also, is it possible to read a file from a remote machine, like a
..TXT file or a .XML file in a specified directory without using the C$, D$,
etc. or other shares? Finally, what rights would I need to read/write a
registry key remotely?

Thanks,
Michael C.
Nov 16 '05 #1
4 11231
The UNC path should work for you as long as you have permission

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"Michael C" <mi*******@optonline.net> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
Hi all,

I'm trying to get a full directory listing from a remote machine. Anyone
know how? Also, is it possible to read a file from a remote machine, like a .TXT file or a .XML file in a specified directory without using the C$, D$, etc. or other shares? Finally, what rights would I need to read/write a
registry key remotely?

Thanks,
Michael C.

Nov 16 '05 #2
OK. Is there a Win32 API function I can call to retrieve a remote
computer's directory?

Thanks,
Michael C

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl...
The UNC path should work for you as long as you have permission

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"Michael C" <mi*******@optonline.net> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
Hi all,

I'm trying to get a full directory listing from a remote machine. Anyone know how? Also, is it possible to read a file from a remote machine,
like a
.TXT file or a .XML file in a specified directory without using the C$,

D$,
etc. or other shares? Finally, what rights would I need to read/write a
registry key remotely?

Thanks,
Michael C.


Nov 16 '05 #3

using System;
using System.IO;

namespace ConsoleApplication4 {
class Class1 {
[STAThread]
static void Main(string[] args) {
DirectoryInfo di = new DirectoryInfo("\\\\barney\\CDrive");
foreach (FileInfo fi in di.GetFiles()) {
Console.WriteLine(fi.FullName);
}
Console.ReadLine();
}
}
}

Is that what you want?

Simon Smith
simon dot s at ghytred dot com
http://www.ghytred.com/NewsLook - Usenet for Outlook

On 10 Jun 2004 22:29, "Michael C" wrote:
OK. Is there a Win32 API function I can call to retrieve a remote
computer's directory?

Thanks,
Michael C

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl...
The UNC path should work for you as long as you have permission

--

W.G. Ryan, eMVP


Nov 16 '05 #4
That looks like it might require a "share" named "CDrive", so it's not quite
what I'm looking for. Here's the deal, I want to get a remote computer
directory listing just like Microsoft SQL Server Enterprise Manager does
when you click on the "Attach Database" function -- no shares required.

Anyone got any ideas?

Thanks,
Michael C.

"Simon Smith" <si*****@community.com> wrote in message
news:b2******************************@ghytred.com. ..

using System;
using System.IO;

namespace ConsoleApplication4 {
class Class1 {
[STAThread]
static void Main(string[] args) {
DirectoryInfo di = new DirectoryInfo("\\\\barney\\CDrive");
foreach (FileInfo fi in di.GetFiles()) {
Console.WriteLine(fi.FullName);
}
Console.ReadLine();
}
}
}

Is that what you want?

Simon Smith
simon dot s at ghytred dot com
http://www.ghytred.com/NewsLook - Usenet for Outlook

On 10 Jun 2004 22:29, "Michael C" wrote:
OK. Is there a Win32 API function I can call to retrieve a remote
computer's directory?

Thanks,
Michael C

"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl...
The UNC path should work for you as long as you have permission

--

W.G. Ryan, eMVP


Nov 16 '05 #5

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

Similar topics

3
5887
by: Nick Bunton | last post by:
I have setup remote debugging on an NT4 workstation for testing. I then build from the debug config on my machine and copy all the files from the /bin/debug folder including the .PDB files. I then...
4
2274
by: JoelWhitehouse | last post by:
Hi! I want to write a script that will read a .php file on a remote server and print to the current page a portion of the text contained in the remote file. I am just wondering what the best...
0
3271
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
2
17365
by: Adrian | last post by:
Hi I have some local pages (on PC harddisk) that act as a user interface and a set of JS files that controls it all. I now want to be able to access a remote web server to read a txt file and use...
7
1515
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
4
1294
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
29
2981
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
1
1390
by: barneymc | last post by:
Im wondering if anyone has come across a way of reading EventLogs using WMI. The event logs files are restored from another server. Below is the C# class that executes the query. NOTE : The...
4
16064
by: Prof. William Battersea | last post by:
Hello, Suppose I have a Vista machine called VISTA and an XP machine called XP in a workgroup named WORKGROUP. Physically they're connected to a router and I can see lists of public and shared...
0
7072
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
7271
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
7319
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...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.