During beta testing some of my testers asked if I can place the three folders my app generates on a server, so that several users could access the data, not just one user on one pc.
My first thought is this is beyond the scope of what I want this app to be, a cheap intro to my company, generate some revenue and build the next product that will have the network ability.
Currently the scope of the project is the users gets the app (windows form application) and it runs on one machine with the folders created on the local drive.
So just for laughs I started to play with this code on a new form app,
Public Class Form1
Public Function ListAllDrives() As String()
Dim arDrives() As String
arDrives = Directory.GetLogicalDrives()
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.Click
'Remove the binding set by the LINQ method
'otherwise, you may get an exception
ComboBox1.DataSource = Nothing
'Clear items already in the list
'Loop through the available drives
For Each d As String In Directory.GetLogicalDrives
'Select the first item
ComboBox1.SelectedIndex = 0
Private Sub ComboBox1_SelectedIndexChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'select drive letter first
Button1.Enabled = True
Button2.Enabled = True
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ComboBox1.SelectedIndex = -1 Then
MsgBox("Please select Disk Drive to create folders in. Some network drives may not be accessable, see your network admin for help")
Dim drive As String
drive = ComboBox1.SelectedItem
If My.Computer.FileSystem.DirectoryExists(drive + "\QPILABS\Machines\") Then
MkDir("drive" + "QPILAB\Machines")
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Here I can find the "F" drive on another computer on the home network but I can't create the folders on that drive.
It does create the folder on my local c:\ without issue.
Question is there a simple way that I can create and use a folder on a network drive? The folders will house .txt files the app reads and writes to. If this is simple I would like to do it but if not I will leave it for when this is reworked as a different kind of app, web app, using data bases rather then .txt files.