473,792 Members | 3,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to view the directory information of the neighbor computer

hi,everyone
I have a question about viewing the directory information of the remote
computer in the local network. I used the C# class: OpenFileDialog which can
not browse other computer's directory information. How can I view the whole
directory information of other computer given that I have one of its
administrator account. Could anyone help me? Thank you in advance.

Best Regard

Zeeway

May 25 '06 #1
10 5852
Hello, zeeway!

You can use WMI ( Win32_Directory ).
or
if you have admin account you can view contents of computers disk,
you access for instance disk C, you will use fillowing UNC path \\computername\ C$

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
May 25 '06 #2
Thank you. I have tried the code:

ConnectionOptio ns Conn = new ConnectionOptio ns();
Conn.Username ="test";
Conn.Password ="123";
ManagementPath p = new ManagementPath( "\\\\192.168.1. 9\\root\\cimv2" );
ManagementScope ms = new ManagementScope (p,Conn);
ObjectQuery oq = new ObjectQuery("SE LECT * FROM Win32_LogicalDi sk");
ManagementObjec tSearcher link = new ManagementObjec tSearcher(ms,oq );
ManagementObjec tCollection queryCollection = link.Get();
foreach (ManagementObje ct dsk in Collection)
{
Console.Write(d sk["Caption"]);
}

It can help me accquire basic disk information on the remote computer, but
the directory and file information on a certain disk still can not be
abtained.
Can you give me a hand any more?
Best Regard

Zeeway

"Vadym Stetsyak" <va*****@ukr.ne t>
Hello, zeeway!

You can use WMI ( Win32_Directory ).
or
if you have admin account you can view contents of computers disk,
you access for instance disk C, you will use fillowing UNC path \\computername\ C$
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

May 31 '06 #3
Hello, zeeway!

z> It can help me accquire basic disk information on the remote computer,
z> but the directory and file information on a certain disk still can not
z> be abtained.

Why can't you use smth like this?
string [] fileEntries = Directory.GetFi les(\\servernam e\$C); //for disk C access
and the same for other disk in the system ( info about them can be obtained via WMI )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
May 31 '06 #4
Hello, Vadym!

z>> It can help me accquire basic disk information on the remote computer,
z>> but the directory and file information on a certain disk still can not
z>> be abtained.

VS> Why can't you use smth like this?
VS> string [] fileEntries = Directory.GetFi les(\\servernam e\$C); //for disk
VS> C access and the same for other disk in the system ( info about them
VS> can be obtained via WMI )

oops I meant
string [] fileEntries = Directory.GetFi les(\\servernam e\C$);


--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
May 31 '06 #5
Hi,
I'm sorry for answering you so late.
Following your advice,I can read the files information now. But if the
remote computer wants me to provide one account and its password to verify
whether I can visit it,Could you tell me where I can specifiy the account
and its password. Thanks a lot.

Best Regard

Zeeway
2006-06-05
Jun 5 '06 #6
Hello, zeeway!

z> Could you tell me where I can specifiy the account
z> and its password.

Before accessing remote resources, you have to do impersonation via LogonUser API.
Take a look at impersonation sample here ( http://www.codeproject.com/csharp/cpimpersonation1.asp )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Jun 5 '06 #7
Hi Vadym,
I tried LogonUser API with the demo as you told me,but I found that
LogonUser returns true when I specify a local user name and its password no
matter what domain I specified. So what does the domain parameter mean? When
the domain is a remote computer and the userName and its password belongs to
the remote computer, LoginUser return false.
Could you give me more detail about the usage of LogonUser?
Best Regard

Zeeway
2006-06-07
Jun 7 '06 #8
Hello, zeeway!

z> Hi Vadym,
z> I tried LogonUser API with the demo as you told me,but I found that
z> LogonUser returns true when I specify a local user name and its password
z> no matter what domain I specified. So what does the domain parameter
z> mean? When the domain is a remote computer and the userName and its
z> password belongs to the remote computer, LoginUser return false.
z> Could you give me more detail about the usage of LogonUser?
z> Best Regard

LogonUser returns security access token. This token is further used with impersonation.
Domain parameter is used if you want to obtain access token of the domain account.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Jun 7 '06 #9
Hi Vadym,
http://msdn.microsoft.com/library/de...us/secauthn/se
curity/logonuser.asp
It's said that :You cannot use LogonUser to log on to a remote computer.

Best Regard

Zeeway
06.06.08
Jun 8 '06 #10

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

Similar topics

14
11510
by: John Hunter | last post by:
I have a list of two tuples containing x and y coord (x0, y0) (x1, y1) ... (xn, yn) Given a new point x,y, I would like to find the point in the list closest to x,y. I have to do this a lot, in an inner loop, and then I add each new point x,y to the list. I know the range of x and y in
1
303
by: Moukarram Kabbash | last post by:
Hello everybody, how can I get the names of all neighbor computers in my local network ? Thanks in advance
0
1367
by: Tomas Vera | last post by:
Hello All, I'm posting this for the benefit of the search engines. I've been developing web apps on my computer for about 18 months using VS2002. This morning, I was showing a colleague how to set up a WebApp project. All went well. I compiled the project then opened a browser and tried to navigate to the page and I got the message listed below. I did some newsgroup browsing and found that since I had both v1.0.3705 and
1
2389
by: Ollie | last post by:
I know this has been asked before, I have read the answers given and I am unable to get this work ( I don't know that much about AD configuration) I have an asp.net web service that is designed to authenticate and maintain accounts in active directory. It all works fine when the web service is on the same machine as the domain controller but when the web service is on a remote machine it fails on any active directory calls. I have...
46
24275
by: Ian Boyd | last post by:
IIS5, on a Windows 2000 Server machine. Debeg.WriteLine "Hello, world!" How can i view it?
0
5415
by: Chung Leong | last post by:
In this brief tutorial I'll describe how you retrieve information from an Active Directory through the OLE-DB extension. While it is possible to use the LDAP extension to achieve the same goal, as you will see using Microsoft's OLE-DB provider is much easier. You will need to download and install the OLE-DB extension. Here's the location once again: http://sourceforge.net/project/showfiles.php?group_id=171247&package_id=198554. See my...
5
5467
by: CBidwill | last post by:
Hello, I'm a ASP.NET developer with a little experience in IIS but I'm having difficulties getting a little ASP.NET application I wrote up on my home intranet. Here's the details: - I can view the site fine where the application is hosted by browsing http://<machine name>/<application virtual directory> - When going to http://<machine name>/<application virtual directory> on a remote computer, I get paged cannot be displayed. - From the...
0
3098
abdoelmasry
by: abdoelmasry | last post by:
hi profs i have PDC, i am trying to ad another domain in the same forest. i alway get his error : The operation failed because: Active Directory could not replicate the directory partition CN=Schema,CN=Configuration,DC=EGYHK,DC=Local from the remote domain controller egyhkpdc.EGYHK.Local.
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.