473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Browse for a network folder

Im trying to write an application which goes through selected servers on the
network and (according to the file path provided) recurses through all
folders and deletes log files that fit a specified criteria.

This is working when passing UNC names between the methods, but the users
need to know the UNC path if the server isnt in the list currently held by
the app.

What the users need is the equivalent of the FolderBrowserDialog that will
accept a UNC path as the root directory. Is this possible? if so how can it
be done?

Cheers
--
David Thorn
Nov 17 '05 #1
1 9797
I know that you can get information about the local LAN and the computers
connected it using the WIN32 API's
WNetEnumResource or NetServerEnum. These are unmanaged API and you will have
to use interop to access these methods, Note if NetBios is not availalble on
your network, then these APIs will not work.

WIN32 API WNetEnumResource
http://msdn.microsoft.com/library/de...umresource.asp

WIN32 API NetServerEnum
http://msdn.microsoft.com/library/de...serverenum.asp
For information about using these API's from .Net (C#) check out the
following:

WNetEnumResource
http://www.pinvoke.net/default.aspx/...esource?diff=y

NetServerEnum
http://pinvoke.net/default.aspx/netapi32.netserverenum

An interesting article on networking in .Net:
http://discuss.fogcreek.com/dotnetqu...ow&ixPost=6605
For an example in Vb.Net of using he above API's check out
http://vbnet.mvps.org/index.html?cod...umresource.htm
And finally for a Vb.Net to C# converter check out:
http://www.developerfusion.co.uk/uti...btocsharp.aspx

HTH

Ollie Riches

"Dave Thorn" <Da*******@discussions.microsoft.com> wrote in message
news:25**********************************@microsof t.com...
Im trying to write an application which goes through selected servers on
the
network and (according to the file path provided) recurses through all
folders and deletes log files that fit a specified criteria.

This is working when passing UNC names between the methods, but the users
need to know the UNC path if the server isnt in the list currently held by
the app.

What the users need is the equivalent of the FolderBrowserDialog that will
accept a UNC path as the root directory. Is this possible? if so how can
it
be done?

Cheers
--
David Thorn

Nov 17 '05 #2

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

Similar topics

1
by: PeterNZ | last post by:
Hi all, I developped an C# app which is using FileSystemWatcher. If a file is created in a specific folder, it opens the file and does some processing. This functionality works without...
21
by: strutsng | last post by:
<input type="file"> only allows the user to browse for files. How about "browse for folder" dialog? Can html/javascript do that? I couldn't find any syntax for that. If not, please advise what...
1
by: Vani | last post by:
Hi All, Is it possible to save a file on a network folder from a web application which is developed in ASP.Net. I tried mapping a network folder on the server and tried to save a file on that...
3
by: VB Joshua | last post by:
How do I call a browse for folder dialog? Dim oBrowseFolder As New System.Windows.Forms.FolderBrowserDialog oBrowseFolder.ShowDialog() But I can not show a form modal for some reason?
5
by: Mitchell S. Honnert | last post by:
Is there a way, given the full path of a folder on a network, that one can programatically tell if you have Read access to that folder? I have an application where the user is able to select a...
4
by: Dixie | last post by:
I want to send a file to each persons home network space. I believe that when a person logs onto a network, some sort of variable is set that identifies the user. Is there any code that would...
4
by: marc | last post by:
Hi, I have 2 activex controls on my form that I need to open up a common dialog box and select/browse files, then populate two text fields. The first one I have working: The first activex...
0
by: doneholmes | last post by:
I have an ASP application that runs on our company intranet. The script checks a folder structure within a network share and, if it contains any files, provides the user a link to the directory. My...
2
by: samvb | last post by:
hi guys,.... I am trying to browse a folder located directly under htdocs. The folder, say called 2007 got 6 subfolders inside it, named 1-6. Each of this subfolders got 2 files each. I need to...
1
by: ArunRJ | last post by:
Hi All, I am new to the networking field. I recently had to share a folder in a Windows XP machine A with another XP machine B. The folder in machine A has some .xls files which I need to access...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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...

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.