Reading Remote Files

M

Michael C

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.
 
M

Michael C

OK. Is there a Win32 API function I can call to retrieve a remote
computer's directory?

Thanks,
Michael C
 
S

Simon Smith

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
 
M

Michael C

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 said:
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

OK. Is there a Win32 API function I can call to retrieve a remote
computer's directory?

Thanks,
Michael C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top