Way To Get Network Directories

Oct 12, 2010

Does anyone know a way to get a list of UNC servers (A.K.A. items in the "Network" system folder in windows vista +, or "My Network Places" in win xp -), and get a list of shared files for a particular server?

When I try to get directories using System.IO.Directory.GetDirectories("\"), it says I need to put it in the form of \UNC serverFile share

View 7 Replies


ADVERTISEMENT

Listing Mapped Network Directories

Jun 21, 2011

How do I get all of the mapped network drives (shared ones) like the ones that a person would see in Windows Explorer? That is,

Network Places
Computer 1
Shared Folder

Computer 2
Shared Folder 1
Shared Folder 2

Is there a command or an API function that I can use to get at least the names of the computers and its folders?

View 1 Replies

VS 2010 - Listing Network Directories

Feb 20, 2012

I have a page in VB.NET that is hosted with IIS 7 on Windows 7 Home Premium. The page has code in the Page_Load event that scans through a directory and adds all sub directories to a drop down list. When testing through VS2010, it works perfectly. However, when I set the site up in IIS, the page loads correctly but nothing is added to the drop down list. My current code is: [Code]

View 3 Replies

Treeview Network PCs And Shared Directories With VB2010?

Sep 9, 2011

I'm working on my first VB2010 project, having used VB6 up to now.In VB6, I used some library functions to implement a treeview of network PCs and their shared folders.

I've been searching, but I've not found a way to get this done with VB2010.

I have found scode to return a list of all the devices local to my network....close but not what I'm looking for.

View 2 Replies

VS 2010 : Listing Directories Inside Directories?

Jul 29, 2011

This is currently the code I am using.

Dim fileList As Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(FolderDialog1.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly)
For Each topLvlFile As String In fileList

[code]....

The above code reads all the files & directories in a selected path. It ignores any hidden folders, like it suppose to. Except it doesn't ignore folders inside of the hidden folders that it finds & I need it to.I can't quite wrap my head around how to make it ignore all folders & files inside of a hidden folder that it find.

View 3 Replies

Making Directories Within Directories Using For Loop

May 3, 2010

[Code]....

it just creates 1 folder but not other folders with in folder.

View 1 Replies

VS 2008 Network App - Send Message Or Network Package To Some Of The Clients In The Network

Aug 18, 2009

Here is my idea so far: I have a bunch of computers connected in a local network. One of them is a MySQL server, one will have a vb.NET program wich will act as a "second server" and the rest will be different clients. What I want to do is that the "second server" will send out some kind of message or network package to some of the clients in the network, and they will execute a code based on what message it is, or what kind of package it is. I'll give you a simple example:

[Code]...

View 6 Replies

VS 2010 Listing All Directories And Files And Sub Directories And Subdir Files?

Jun 19, 2012

I need to list all files folders, subfolders and subfolder files under a selected directory in a list box not sure how to do the logic in the last amount of code lines to enumerate all subfolders dna files.Here is what I have so far:

Dim OldProfileDir As String
Dim NewProfileDir As String
Dim Newdocs As String = ""
Dim Olddocs As String = ""

[code].....

View 3 Replies

Using Directories, Sub-Directories And APIs?

Jul 11, 2011

Basically I'm going to try and develop a software that merges PDFs automatically using the PDFSharp API.What I want in the program is to basically that: Have the program to give and Input and Output directoryMerge all the documents in the directory or sub-directoryRename the merged PDF file according the the name of the directory/sub-directoryIf the folder has PDF files and a Sub-Directory I want to merge the PDF files in the folder and rename them as per the main folder, and rename the files in the sub-folder according to its name (i.e. seperate|)

It's the first time I'm using an API.The problem I have is how to use the directories and sub-directories as I need them.

View 2 Replies

VS 2008 My.Computer.Network.Ping() Cannot See Network Under Windows 7

Nov 18, 2011

I have a .NET 2.0 *.dll that calls My.Computer.Network.Ping(). The *.dll is then run out of an *.exe via AppDomain.CreateDomain() and Invoke(). The problem is that this works just fine under Windows XP but under Windows 7, I get an exception saying that no network connection is available. I tried the Ping() call out of a small console application under Windows 7 and it works just fine.

[Code]....

View 6 Replies

.net - Using A FileStream On A Network When The Network Drops?

Mar 26, 2012

I am writing some code as part of a framework for opening a file.The file is of custom type and should not be opened by more than one instance of my application. To stop multiple file opening I use a filestream to create a lock file and then keep said filestream open. This seems to work in preventing another instance of my application from opening the file ( as it will fail in recreating the lock stream in the files open code ) but if the file is on a network share and the network drops then the original application also can not access the file any more.The code to get the lock stream is as follows:

Try
' We need to keep this stream alive to prevent other applications gaining access to the lock
mLockStream = New FileStream(mLockPath, FileMode.CreateNew, FileAccess.Write, FileShare.None)[code]....

In this I create the lock stream the first time round and then if another application tries to create it, it throws an exception and stops them from getting any further. This is kind of how it needs to work, unfortunately as I said, if this is done across a network and then the network connection is dropped for some reason then I can not delete the lock stream as I get an IOException telling me a process cannot access the file as it is open in another process ( which shouldn't be happening I don't think).

View 1 Replies

Transfer Files From One Computer In One Network To Another Computer With A Totally Different Network

Jun 22, 2011

I have a problem I want to make a server and client where the server is password protected and will make the client display files/folders in a designated folder which will be in the server's current directory and the client will ask what IP and password to connect to and if the password is correct is allows the client to access the files/folders in that folder in C.D. of the server and the client can download any file within the folder by clicking a button, yet don't even know where to start.

View 7 Replies

.net - Listing All Sub Directories?

Jan 18, 2012

how to list all subfolders in vb.net. i want to put it on a listbox, i have created a code but it only search on the current location, and does not include subfolder. here is my code,,

Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

[Code]....

View 2 Replies

Get Directories From Txt File

Sep 1, 2011

I need a code. How i can to verify if files of txt exist ? I have a txt file with a directory on each line and I want to verify for all of them. Example:

[Code]...

View 1 Replies

How To List Directories On FTP

Jun 25, 2009

I'm trying to make a simple program to list a directory and sub directories on an ftp. I haven't found anything simple to do this other than a dll made for ftp commands. There are two problems with that dll, the first is I can't get recursing through directories to work right and it has a trial period. So I'm wondering if there is a simple pure VB way to simply list directories on an ftp. The dll I've played with is ChilkatDotNet2.dll.

View 4 Replies

How To Manage Directories

May 29, 2012

I am now convinced there is no such thing using VB 2010 Express. I have read, re-read, studied, copied and pasted code to no end and all I get are error messages galore. It appears there is a big gap between what's on line as far as tutorials and the code that VB 2010 Express will accept. I hate to sound so lost but at the moment I am. I used to program in BASIC and QBASIC. I was a master at opening up ascii text files, reading them in sequential order, sorting, manipulating, then re-writing them. It was all so easy, like this: [code] That's all I want to learn how to do for the moment. But every tutorial or article I find goes off in to wild tangents about How to Manage Directories or it reads the entire text file into one giant object. Or worse, there's some code which looks promising but it won't run under VB 2010 Express or it might run but the author leaves out important parts of the code that have to be declared ahead of the subroutine....you all know what I mean. It can't be this difficult to just read a text file one line at a time, therefore it shouldn't be so difficult to find an accurate and up to date article on this.This is for really rough programming. I don't need an interface of any kind. The user, will not even need to know that anything is happening. I simply want to read text files, manipulate what's in them and then re-write the edited text.

View 5 Replies

No System Directories

Oct 25, 2010

I get the directories like this:[code..]

However, it returns all directories even system hidden ones.It seems that this just follows what I set in Windows for file and folder browsing, since I set the Windows to show all files, I think it's also showing all folders to me, I am not sure however.

I just want NOT to get the system directories like Recycle Bin and System Volume Information, how to do that?

View 6 Replies

Add Image Directories Using List Of(T)?

Oct 10, 2011

how can i add image directories using List Of(T). I can only know to add integers, strings e.t.c

View 4 Replies

Application To Monitor Several Directories

Apr 20, 2011

I have put together an app to monitor several directories. The basic principle is to replicate from a Master directory to a Shared directory when specific criteria is met (specific file types are changed, renamed or deleted within the Master directory)Everything seems to work fine with excpetion to MS Office documents. e.g. If I work on a .bmp and save it, it will trigger a changed event. However, with office documents (Word in this example), it appears to rename the MYDOC.DOC file to <freefile>.TMP then rename a different <freefile>.TMP to MYDOC.DOC. This would not be a problem if it was to trigger the Changed or Created event for MYDOC.DOC, but it doesn't. It wouldn't be so bad if the first TMP file was named the same as the second TMP file as I could mirror the process using the Renamed event.I can not filter out TMP files as we use TMP files within the Master directory, albeit for a different purpose.I would use an off the shelf produt, but the files need to be copied to different shared directories based on specific criteria so I can not seem to find a suitable product that fits my needs.

View 1 Replies

Check If Ftp Directories Exist?

Nov 18, 2009

i am having a problem in writing the code that checks whether a directory exists or not in FTP using vb.net..

View 3 Replies

Compare Files In Two Directories

Jul 7, 2010

I need to check files in one directory that end in 'ilk' and compare it to another directory with files that end in 'txt'. If the file name matches (with the exception of the extension), then I want to delete the file that ends with 'ilk'.

View 7 Replies

Copy Sub Directories To Directory?

Aug 25, 2011

Referencing this question/code:

How do I copy a folder and all subfolders and files in .NET?

I'm trying to copy a buntch of sub directories to a different directory. I'm wanting to update this code:

Dim fso As System.Object = New System.Object
fso = CreateObject("scripting.filesystemobject")
fso.copyfolder(sour, dest)

[Code].....

Is there a easier way of doing this with less lines of code like the fso As System.Object version? Also, I have System.IO imported however File.Copy and Directory.GetFiles are not colored blue, could this be the issue? I have the System loaded as a reference.

View 1 Replies

Count Directories In Folder?

Nov 19, 2009

I need to count the numers of directories in a folder( by path ) How can i do that? should i just add something to this?:

Dim path As String = Application.StartupPath & "\Bin\"
Dim sf As String
For Each sf In Directory.GetDirectories(path)
Next

View 9 Replies

Delete Specific Sub Directories ?

Sep 11, 2009

In all directories on disk is a specific subdirectory which i want to delete on regular basis. Is there a way to do this in a script.

View 2 Replies

Distinguish Files From Directories .net?

Oct 15, 2011

I want my to create an explorer like application. What control should i use to show the contents of a directory.I tried listview and listbox. Unfortunately i was unable to add items in a listview using the function getdirectories("D:")I managed to do so with listbox control. But how can i distinguish whether the selected entry is a file or a directory. Code snippet is given below :

Private Sub ListBox1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
<strong>sel = ListBox1.SelectedItem</strong>
ListBox1.Items.Clear()

[code]....

I want that if thesel is file, then it'll be open in its default application,i.e. using system.process.start(sel.filetype).Else if sel is a directory then the directory will open.

View 2 Replies

Enumerate Directories And Size?

Sep 27, 2010

I want to enumerate all the directories in C: and also at the end of it I want the size. Now, I can enumerate the directories but I have no idea how to get the size.

I have the code here but everytime I try and add My.Computer.FileSystem.GetFileinfo it bombs out saying that I have not expressed it. I suppose I need to add a variable for my.computer.filesystem.getfileinfo but how do I add two variables in one for each statement.I guess I could declare it outside the "for each" statement.[code]...

View 1 Replies

Get All Folder / Directories List

Mar 11, 2010

I'm learning VB and having a few problems with getting a list of all folders/directories on the system. I'm using the code included here and it seems to work until it hits the recycle bin folder, and some other system folders..[code]

View 2 Replies

Get The Windows And System Directories?

Feb 19, 2009

I'm running VB .NET 2005, and need to get the windows directory. I am aware of My.Computer.FileSystem.SpecialDirectories, but it doesn't have either the Windows directory or the Windows/System directory.

So, how do I get the windows and system directories?

View 5 Replies

How To Create Multiple Directories

Apr 6, 2010

I want to create multiple directories using VB.NET. All I am trying to read a text file which holds all the paths and file names some thing like:

c: est.txt
d: est est.txt

The code which I tried o write down is:

If File.Exists(fileLoc) Then
Dim objReader As New StreamReader(fileLoc)
Dim TextLine As String = ""

[Code]....

View 6 Replies

How To Delete Entire Directories?

Jan 20, 2010

how do you delete entire directories?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved