FI am working on a program that will help clients map a network drive by listing all available/visible network shares and allowing the user to select a share to map to. I have already created a basic VB script that will map a drive using a specified location. I have searched and read everything i could find and it looks like this can only be done by calling an API function but am unsure how to do this. [code]
I have scoured Google to find some examples - but they are either completely cryptic (I'm not afraid of Windows APIs either) or don't seem to work. I want to build a list of available shares from my network. I will filter them before I present them to the user. It might work if there was a simple way to get the network folder so I could enumerate them like regular folders...
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]
I need to add some document management functionality into my software. Documents will be grouped by company name and project name. The folders need to be accessed by the application using the id numbers of clients/projects, but also easily browsed by the end user using windows explorer. Clients and Projects will be stored in a database. I am thinking of having the software create the folders using the friendly name and then using a hidden share with the id number for the software to access the files. [Code]
By using the hidden share, if the company name changes or its renamed for some reason it doesn't break the link in the application because its using the hidden shared based on the ID that never changes. Will having hundreds (maybe thousands) or hidden shares on a server provide a huge performance hit? Does any one have any suggestions or alternatives to provide this feature?
All I am trying to do is write a simple program that will let me choose a directory and get a listing of all files in that directory and its sub-directories and show it in a RichTextBox. I got as far as being able to select the directory but when I click "OK" I get "access to c:documents and settingsstevedesktopmp3 is denied".The code I am using is listed below.
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:
I've got a panel - that's in a group box. All of this - with lots of other textboxes on labels - is in another panel (the big panel).I make the big panel visible and not visible based on selections made by the user.This small panel - that's in the group box. I cannot seem to make it appear.Even if I leave it VISIBLE at design time - the objects in it will not appear.Is there some kind of nesting problem that I'm not aware of!
I have five menu items that i have created as a user control and placed on the master page. Now i want one of the menu items to be visible only for particular user role and not visible for others. Here is what I did. Its not working though.
I'm having an odd problem when making a form visible and not visible and it not continuing to function. Here is what I have happening. I have a main form (frmMain) that is an MDIParent. On this form I have a menu to open a second form (frmCalculate) and populate a listview from Items in the database.
As I click or select items in the listview on frmCalculate the tag is read and data is pulled based on the id stored in that tag and fills in various fields on the form. This works great. However, I also have a context menu attached to the listview that allows me to perform a "what if" scenerio on the items I am calculating. When I select this menu, I hide the frmCalculate and open the frmWhatIf form where I can mess around with values on the item I had hilighted in the listview on frmCalculate. Nothing is pulled from or written back to the database here, all the information is filled in from fields on frmCalculate. It just allows me to look at rising costs and how they will affect my margins.... anyway.
If I then close frmWhatIf, it brings my frmCalculate back by setting its visible propery to true (never closed frmCalculate, just hid it). At this point if I click an item in the listview I get an exception for a null reference. IF however I never hide frmCalculate, I can open and close frmWhatIF without ever having an issue. Why do I lose the functionality to select items just by hiding and unhiding the form? As a test I added two menus to the toolbar on frmMain one called hide and one called show. I then opened frmCalculate with original menu item to populate the listview and selected a few items to test that it was working and then using the hide menu I made the form invisible and the show button to bring it back. This yielded the same exception so without even opening frmWhatIf the problem still occurs.
I have placed several PictureBox Images of different colored dots(which represent lights) on an image of a Christmas Tree. I can make the lights randomly flash using a randomGenerator and a Select case statement. However, the code is very long. There are 67 lights on this tree and the code is 71 pages long. There has to be an easier way to do this. So far I have tried the following with two images of lights just to see if it would work and it does not work:
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.
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).
Below is the exception code info. when I try to make form visible for the first time from another form then I get an exception code. something like 'a required variable not set'
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
I came across this on a VBA written program and was wondering if it is possible to do the same on visual basic with the divider?So far I tried to populate a combobox using sqldatareader but can't get the same result.
how to get a listing of a directory file, listed by bytes in basic? I'd like to how write a dump utility and no not of any particular diectory. I am interested in dumping directories in general.
I have a folder with .txt files in it. How can I make my menuitem get those .txt files and put the filenames in the menuitem, so that it creates a list of all .txt files in that folder. So when I put a .txt in the folder the program automatically creates the menu item.
Is it possible to list the available MySQL databases on a computer?At work we run a model that generates a MySQL database full of results, 360 odd tables, when the model is a MySQL database is created containing the results and what I need to do is to be able to list all available databases, allow one to be selected and transfer all of the tables to a blank Access database cretaing the relationships once all of the tables have been created.The tables contain all the primary keys and foreign keys, eg Table1 may contain cust_Numb and table2 may contain cust_numb_pkey.Is this possible?Initially I asked this on a ACCESS forum, but am hitting a few brick walls so thought I'd ask on here as well.
I am trying to read infofmation from the database where i list each department and thier subdepartments in the database so i have all departments and subdepartments in one database Called Departments there is also a field called SubDeptID the SubDeptID will have the value 0 if the department is a parent or a top level other wise it will have it's parent DeptID now i used 2 function to try to create this - it seems that the function add only the parents to the listbox but not the childrens?
here are my functions
Code:
Public Shared Sub FillDepartment(ByVal DropName As Telerik.WinControls.UI.RadListBox) Dim displaymember As String = "DptName" Dim valuemember As String = "Deptid"
I have created my own file system that is used for heavily encrypting all files on the drive. It has to use up to 7 partitions though. What I need it to do is add all partitions/directorys/files to a treeview. Something like this:
for each partition as safTfiles.partitions.partition in drive add_partition() for each folder as safTfiles.folders.folder in partition add_folder_to_partition
[code].....
so it need to be able to click on a treeview node and expand, showing all subdirectorys and files.
I am using the following to get an array of a directory. I was recently told that I needed to process my files in date order.
Dim filelist() As String = IO.Directory.GetFileSystemEntries(CustomerDirectory, ConversionWildCard) For Each filename As String In filelist 'do conversion here Next
I need to write a process which filters out 'old/dead' job files from a directory (actually two directories). This process needs to 'read' a number pattern (in a fixed position) off the filenames (for which there will almost certainly be duplicates), and having then 'got a list' of unique number patterns, give these to a function (which I already have) which will give a boolean, from which I can decide to either delete those files whose name contain this particular number pattern or not - this is intended to be run each night (windows task scheduler). Example directory content is:
[ode]...
I know I can get a listing using Directory.GetFiles(dirpath, "SUB_*.xml") but am stuck on how to go about the rest.
if anyone knows if I can get a listing of all of the sub/functions in a class/module. Just the definitions (That is, the name, paramaters etc., but not the code).
I'm trying to find an easy to create a hierarchical directory structure that I can put in a TreeView, with two caveats:
1) The file list is from a file
2) The paths are un *nix format (e.g. /dir/dir/file rather than c:dirdirfile)
I found this ([URL]) which would do what I want...if not for the two caveats above. I can go through the process of tokenizing the paths and start creating linked lists of objects for a directory structure, but before I do that I'd like to find out if anything else is available...
i.e. All the types tabbed to line up.When I click "Pretty listing (reformatting) of code" in settings, it won't let me do this - and without "Pretty" switched on, the code is a mess (as a VB programmer, I'm not used to having to do things myself).Is there any way to configure this all or nothing option so I can get the best of both worlds?