473,461 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Create 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 11221
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
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
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
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
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
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
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
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
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.