Note that there are some explanatory texts on larger screens.

plurals
  1. POVariable is not declared; it may be inaccessible due to its protection level
    text
    copied!<p>Today I decided to come up with a program that would be useful for me in VB.net (I have never coded in VB.net before). All is going fine up till this point but I have hit a snag with the error mentioned above. The problem is with the windowssevenexistsonsource boolean under the get get of profiles comment. I will also take any code criticism well as I would like to get out of bad practices before I start! (the sub does end but I have not included that code)</p> <p>Code:</p> <pre><code>Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Check that the entries required are not empty If String.IsNullOrEmpty(sourceipaddress.Text) Or String.IsNullOrEmpty(destinationipaddress.Text) Then MsgBox("Source or destination IP address is empty") Exit Sub End If 'First we need to establish the operating system of the source and destination Try Dim windowssevenexistsonsource As Boolean = IO.Directory.Exists("\\" &amp; sourceipaddress.Text &amp; "\c$\users") Dim windowssevenexistsondestination As Boolean = IO.Directory.Exists("\\" &amp; sourceipaddress.Text &amp; "\c$\users") Catch ex As Exception MsgBox(ex.Message) Exit Sub End Try 'Now we need to get a list of profiles in the relevant directory and put them into an array 'Declare variables and empty the array Dim Sourcedirectorylistarray, destinationdirectorylistarray As String() Dim sourcedirectoryentry, destinationdirectoryentry As String Dim Sourcerootpath, destinationrootpath As String 'Get List of Profiles Try If windowssevenexistsonsource = True Then Sourcedirectorylistarray = System.IO.Directory.GetDirectories("\\" &amp; sourceipaddress.Text &amp; "\c$\users\") destinationdirectorylistarray = System.IO.Directory.GetDirectories("\\" &amp; destinationipaddress.Text &amp; "\c$\users\") Else MsgBox("test") End If Catch ex As Exception MsgBox(ex.Message) Exit Sub End Try </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload