Mr.M 89 Future Programmers

Yes by just reading through your code I noticed that you didn't specify where "names.txt" is located which is why you don't get nothing, if had use the Try block you would have noticed that.

Mr.M 89 Future Programmers

But I must say, just noticed that using the code to skip the files will skip if you not performing AllDirectories search because this will also still throw and exception because it will reach the directory that it can't access and handle that, but since it need to search for all the folders, subfolders, files, it will then try to open it then an Access denied error will be thrown. You can pass this when you are performing TopDirectoryOnly, so I think the best way would be to loop through the files like this:

1) Start by using TopDirectoryOnly and get all the directories on and also those that are accessible, then you will need 4 Array Variables here, or 4 textfiles (you can also work with one textfile too), or a database with atleast 4 tables(T1-FistAccessible, T2-FirstInAccessible, T3-SecondAccessible, T4-SecondInAccessible).

The 2 variables will used to hold folders that are accessible and folders that are not accessible. NOTE These are first folderLevel (TopDirectories). Now because on our drive we know which folders are accessible and which folders are not then

2) Use the collected info about the folder and perform again the TopDirectoryOnly search option here and check if the folder are accessible or not. The reason why we perform two is because the inaccessible may not be on the top folders like a folder called "Application Data" on my system I can access it so if in the second search you chose to do AllDirectories search option you most …

Mr.M 89 Future Programmers

Sorry guys for late reply, was busy with other projects and one project had the same problem as I stated here so I deg more on google and was able to find the solution, and the solution was simple the matter of adding all possible catch exceptions like:
UnAunthorizedAccess, InvalidFile, etc

Solution I used was this found here: http:\www.xtremevbtalk.com/showthread.php?t=318429
Also coming to a part of skipping, I put a Try statement then inside the Try I then added a For Each loop then on its Next I then added the value I Added on the For Each like this just in case someone experience the very same problem of skipping inaccessible file on a system:

 Dim dDirectory As String
 Try REM: Some may remove this try but I just feel much safe with it, but you can remove it.
 For Each dDirectory In Directory.GetDirectories("D:\", "*", SearchOption.AllDirectories)
 Try
 REM: Do your what you want with the directories or here.
 Catch ex As UnauthorizedAccessException
 REM: This is where I populated my inaccessible file because of UnAuthorized file access

 Catch ex As AccessViolationException
 REM: Populate file that are not accessivle because of violation
 Catch ex As Excpetion
 REM: This helps to identify why the system failed to continue so use this to get all the possible exceptions and then handle it just like how I did above.
 MsgBox(ex.Message) REM: the massage will tell what exception it has come across and you can then handle that exception.
 End Try
 REM: …
Mr.M 89 Future Programmers

Hi Dw.

I'm tryign to change a registrykey on my system but I get this error: ArgumentException was unhandled, The specified RegistryKeyPermissionCheck Value is invalid. Parameter name: mode

here is the line that throws this error:

regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Root & Last, True, (Security.AccessControl.RegistryRights.FullControl))

and the rest of the function code is:

Private Function GetRoot(ByVal Adapter As String) As String
        Dim regKey As Microsoft.Win32.RegistryKey
        Dim i As Integer = 0

        Do
            Dim Root As String = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\"
            Dim Last As String = DoPadding(i)
            regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Root & Last, True, (Security.AccessControl.RegistryRights.FullControl))

            Try
                Dim cAdapter As String = regKey.GetValue("DriverDesc").ToString()
                If cAdapter = Adapter Then
                    Return Root & Last
                End If
            Catch
                Exit Do
            End Try
            i += 1
        Loop
End Function

This funtion is called after clicking the update button to update the mac address.

Private Sub bt_update_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_update.Click
        Dim mac_text As String = m1.Text.ToUpper + ":" & m2.Text.ToUpper + ":" & m3.Text.ToUpper + ".:" & m4.Text.ToUpper + ":" & m5.Text.ToUpper + ":" & m6.Text.ToUpper
        If IsOkay() = False Then
            Exit Sub
        End If
        Dim regKey As Microsoft.Win32.RegistryKey
        Dim Addr As String = GetRoot(combo_network.SelectedItem.ToString())
        regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Addr, True)

        regKey.SetValue("NetworkAddress", mac_text.ToString.Replace(":", ""))
        ShowRestart()
    End Sub

I've tried changing all the available access/modificication permissions that are available within that line but still it just throw this error message.

Thank you

Mr.M 89 Future Programmers

As I've stated, I wanted to do this in vb, the only problem is recording video in combination with audio.

Mr.M 89 Future Programmers

Have you checked the link? The solution is provided there all you need to do is first test it then make it support what you want

Mr.M 89 Future Programmers

Check this out:
www.stackoverflow.com/questions/23050880/webclient-login-failure-in-vb-net

Mr.M 89 Future Programmers

Ok, this worked to me, what I think you need to do is that instead of creating lots of IF statements without the ELSE could be the course why you don't receive this error message. Try to add the Else to your code like this:

 If radBusiness.Checked = False And radResidential.Checked = False Then
 REM: Do what you need here
 Else
 If radBusiness.Checked = True And lstConnection.SelectedIndex < 0 Then
 REM: Your current error that you say you don't receive here
 Else
 REM: Continue with your If Statement here, and so on keep applying the Else to a so common items conditions to the end and close all you if statements with End If
 End If
 End If

Please try that and see.

Mr.M 89 Future Programmers

If your question has been answered please mark it as solved.

Mr.M 89 Future Programmers

Try to make your variables as Global and see, also try to add another IF statement inside the current IF statement. The IF statement you need to add will be for checking if the dataread student number matches the student number supplied in a textbox if these match then populate data to textboxes or else just clear the textboxes that will ensure that its populates data based on the current entered student number on a textbox.

Mr.M 89 Future Programmers

I think the problem is within your IF statement, will try this and hope I will manage to figure out the problem, because there is something I'm suspecting so just want to make sure of it.

Mr.M 89 Future Programmers

I think maybe the command is too long so it need to cut the edges. I think it my also help if you could post the code as well.

Mr.M 89 Future Programmers

Which error message doesn't display?

Mr.M 89 Future Programmers
Mr.M 89 Future Programmers

What error does it throw?

Mr.M 89 Future Programmers

That's great. I think you may now mark this question as solved then.

Mr.M 89 Future Programmers

Try this. You will have to change the naming. I have a Label which is Label2 which acts as a Total price or (Current Total) and I'm using ListView4.

 For Each iItem As ListViewItem In ListView4.SelectedItems
 ' I declared the variables I will use to keep track here.
 Dim Price_To_Deduct As Integer ' I used Integer because I didn't format the numbers to money format so you can try using Double but I haven't tested that.
 Dim Current_Total_Price As Integer ' This variable will contain the current total price which we will deduct from.
 Dim New_Total As Integer ' This will contain the new total.

 Price_To_Deduct = iItem.SubItems(1).Text
 Current_Total_Price = Label2.Text ' Retrieving the current total price so that we will do calculations.
 New_Total = Current_Total_Price - Price_To_Deduct
 ' Because I'm using a Label I now have to clear it and reUpdate it with the new total.
 Label2.Text = ""
 Label2.Text = New_Total
 Next

This should work.

Mr.M 89 Future Programmers

Yeah I think that will be a problem, but I think (note sure if its possible) to let the server as a relay be the one that gets the time its received the data from let's say Client1 and send it to the desired client which in this case is Client10 then the client10 will then send maybe a message (R) for received then the server will then send this to client1 to notify the sender that his/her data was successfully sent and has been received.

I think this will help so that the server will compare the time it sent the data and the time its received the response and I will have to write this to a log file for now to check the speed in different network connectivity.

Mr.M 89 Future Programmers

How the data is sent and received? Meaning which software used? Yours or third party software which is sending and receiving the coordinate.

Mr.M 89 Future Programmers

Ok. But I'm a bit not sure if I keep the server as relay, if the communication between clients will be in real time.

Mr.M 89 Future Programmers

This could really depends on when do you want to fill it, just as Jim had said. There are quite a number of ways you can achieve this. Could you tell us when do you wish to fill it?

Mr.M 89 Future Programmers

Thanks, just to answer your question on how and when will a server knows when to cut a connection, the server will keep some essential details of the clients like for instance the counts(time) the client is given to communicate with another client, so let's say the client now has (1925) so for each interval or timer tick while the client is in communication (connected) with another client the server will do the count down from the contactor time so when the count reaches (0) then the server should cut immediately the connection and drop all message packets that were sent between the two.

So that's how a server know when to stop the connection so that because clients may share large files so that will also have its own time given just like (Data bundles) and that will be counted per each KB/MB sent as well as received too so that the clients can be controlled on the connection time, they must not connect for too long.

Thanks will look at the links then will get back as soon as I'm done looking at them.

Mr.M 89 Future Programmers

Ok pleasure is all mine.

Mr.M 89 Future Programmers

Ok this now just sound more complex, as you said if the server establish connection and handing over to the clients to communicate the server won't have any control of cutting the connection, just thought but I don't know if its possible, suppose 'Client1' is connected and are exchanging messages with 'Client10' and the server come to a point where it must cut the connection between these clients, since the server won't have any control of cutting the connection, is it possible that a server can send a message to a client that requested this connection or the client that requested to be connected with another client, the server will send a message to this client to cut immediately the connection between the connected client and free up every used stream?

I just looked also at peer to peer but didn't find an article that I could understand on how to send data to a particular client from another client.

I thought this was gonna be easy but now it seem difficult. Only if I can be able to send data from a particular client to another client I think that will help, will have to deal with how the server can control the connection between these clients later.

I saw another post where it was suggested to use the MeshTable and the use of Usernames to identify the target client, the other article which is a WCF used something which was interesting, the Author said the client also acts …

Mr.M 89 Future Programmers

I think I need to try simplifying this. Suppose I have 10 clients that are connected to a server. NOTE1: A client can send data to a server and a server can respond to that "particular client".

So suppose Client1 want to send let's say a 'private' message to Client10, so because this message is private it must only be received by Client10 because the message was sent to him.

So firstly how can I achieve that? This is more similar to what I asked before just that now it will be the server that will deal with locating the contacted clients and the clients should be able to send data between them only no other client to receive that message. NOTE2: The message is not from the server it from

  Client1 ------- Server ------- Client10

Ok I won't complicate this now. That's what I want to achieve.

Mr.M 89 Future Programmers

Ow and another thing is that I did notice that you said at the first time the item should be compared between ListView1 and ListView3 then the second Time you click the button you want to compare Items between ListView2 and ListView3,
Mmmm, at least for me this is impossible to achieve the way you want it, just re-read your third post, you want to check this automatically and move automatically from the first item to the end of the items. The reason why I say this is practically impossible at least for me to achieve it, is because its so hard to track the items in the ListView, so for that you would need to use the index but now I personally didn't find it or wasn't able to use the index which was going to be a bit easy.

So the ListView I didn't see the ItemIndex and I don't know how to find it, unlike a ListBox because you would have called for the first item you would do something like this:

 ListBox1.SelectedIndex = 0

So the ListView doesn't or I didn't find this which is why I say at least for me what you want to achieve is impossible for me, which is why even on the above post you first need to select an item on listview1 manually before clicking the button, there wasn't an automatic way I could do it, but I guess someone mite be able.

If you would …

Mr.M 89 Future Programmers

Ok as I've said, I've managed to do this but there is just one problem I faced when doing this, after a lot of challenge trying to do this.

The current problem is that yes it can check the Items on ListView3 if there are the same with the selected Item in ListView1, but it can't detect the duplication of the transferred item, mean if I transfer let's say "Item1" to ListView3 because its not there it will transfer it, but if you click the same Item again which is "item1" in this case the item will be transferred again so it does not match the items that it has transferred so I think there will be someone who mite be able to solve this. Here is the code I've used. Because of slit or complication of this I've used the counts to stop it from sending many items at a time so the counts will stop this. Declare the count as a Global Integer Variable so that it will keep there the counts.

 count = 0
 Dim lstV1Item As String = ListView1.FocusedItem.Text
 count = count +1
 For Each item As ListViewItem In ListView3.Items
 ' Let's Check if the ListView1 selected Item matches with any Item that is on the ListView3

 If item.Text.ToString.Equals(lstV1Item) = True Then
 ' We have a match so let's stop everything and remove it from the variable so that it won't be added by any accident means.
 count = 0
 lstV1Item = ""
 Else …
Mr.M 89 Future Programmers

Ok. About my previous post, I think you can still use the ListView. I will work this out and I hope I will post back as you asked.

Mr.M 89 Future Programmers

Thanks but, what I'm trying to say is that the server knows the clients IP address because I use "Client(index)" to support multiple clients, but now let's say there are 10 clients connected and client1 wants to connect with client10 so the server already know all of the connected clients but to enable client1 to communicate with client10 they need to connect, so these clients IP addresses will be saved on a database then when the client request to be connected with another client, the server will retrieve the clients IP and connect them up, the data that is sent between these two clients must not be sent to a server it must be between these clients that had been connected up, but the server should be able to take control between these clients, meaning the server must also be able to cut connection between the two at some point.

The server will be the middleware and connector too.

Mr.M 89 Future Programmers

Hi Dw.

I'm developing a Client Server application. At the moment I can connect the two and send data. The main aim is to make a server as a core control. The server only perform actions according to each client request, so the client can request to connect to let say "@Bob" where in my database on the first time "@Bob" initialized a connection with a server he registered a username "@Bob" and the server will capture the IP address of "@Bob" as well as the username "@Bob" and registered it on a database so that when let say "@John" wants to connect with "@Bob" can type in a textbox like this "connect @Bob" then when the server receive this message the server will then look in to a database in searching for a username "@Bob" and if the username is found then the server will retrieve the IP Address of "@Bob" then use it to send a message to "@Bob" that "@John" wants to connect with him, I will stop there because the only part I want to know is how to connect to a client using an IP address.

I must say this, the clients will in most cases be always connected to server so the server will only use the IP to check if the desired client is still available or reachable, then the server will send a message notifying the contacted client that there is someone contacting him/her then if the contacted clients accepts this request …

Mr.M 89 Future Programmers

@Dj yes I agree, I posted the use new line early then later when I was in front of my pc I then noticed that its not working. But I got your point there.

@Wishala you should have cleared that out, if so then you can use Dj's suggestion.

Mr.M 89 Future Programmers

@DJ but there are situations where the items are retrieved somewhere maybe from a file or from a database then are added to a control, so I think we shouldn't stick much to the way of how the OP is adding because we may find that the data is retrieved some where else and it is dynamically updated so the OP may need to add it just like how he do, unless the data won't be updated at a later stage then the OP can add it internally or within IDE. Just saying

Mr.M 89 Future Programmers

I've just worked with another project where the OP was also doing something similar except that, that's OP wanted to make more then one selections at the same time, as I worked with that's OP's question I noticed that even if you add the code for new line, the new line won't be added so I prefer you use ListBox instead of ListView, unless its a must do with a ListView.

ListView seemed to me that it had some limitations on doing things with it. With a ListBox what you require can be achieved so early.

Mr.M 89 Future Programmers

Meant in ListBox1 not ListView1

Mr.M 89 Future Programmers

I've tried this out using the ListView but wasn't successful, then I change from ListView to ListBox which then I managed to do what you are trying to do. With the ListView I noticed that you can't select two listviews but with Listbox you can which made it impossible at least for me to do it using the ListView.

This is what I've done with listBox:

I've added 3 ListBoxs to my form then I double clicked the ListBox1 and added these codes:

 If ListBox1.SelectedIndex = 0 Then
 ' The first item is selected on ListView one so let's also select the corresponding item in listbox2 as well.
 ListBox2.SelectedIndex = 0
 ' Now let's transfer the selected items to ListBox3 one item per line.
 ListBox3.Items.Add(ListBox1.SelectedItem.ToString)
 ListBox3.Items.Add(ListBox2.SelectedItem.ToString)
 Else
 If ListBox1.SelectedIndex = 1 Then
 ' Same as above except for the index number now. The index number to be used now is 1

 End If
 End If

Hope this answer your question.

Mr.M 89 Future Programmers

An example based on your above code will be:

 List1 = Me.lsv1.Items.Add(Me.txtDescription.Text & Vb.NewLine)
 List1 = Me.lsv1.Items.Add(Me.txtPrice.Text & Vb.NewLine)

Something like this should help do what you intend to do.

Mr.M 89 Future Programmers

You need to add

 &VbNewLine

at the end of the add statement so that when you click twice it will write the data on a new line below the previously added data.

Mr.M 89 Future Programmers

Well I didn't get your question straight, so I will try to break it down please correct me if I'm wrong. I think you want to transfer the selected data from let's say ListView1 to ListView2 and ListView3, the ListView2 and ListView3 can be either on the same form with ListView1 or on a different form(s). Am I correct? Please enlighten me there.

Mr.M 89 Future Programmers

Don't forget, if your question has been answered to mark it as solved.

Mr.M 89 Future Programmers

The above is one URL address, it also have a very good example of how to use it.

Mr.M 89 Future Programmers
Mr.M 89 Future Programmers

WebClient.DownloadFile seem to be easy to work with, have a look at it.

stackoverflow.com/questions/4066082/download-file-in-vb-net-2010

Mr.M 89 Future Programmers

Did you read the guide? Also you can google there are other SDKs that you can also use instead of OZEKI. But Ozeki also provides with customer care so you should contact them and they will guide you on how to setup your computer to be able to send out SMSs. There is another software called wise:sip which is sort of a full voip network operator you can download, you will need the VMware, Linux OS, then you can create accounts there and then use the info from there to your VB app with that you will send sms's as if you are sending emails but the sip:wise will translate and deliver it to the destination. This require a bit knowledge on VOIP as well as Networking.

Mr.M 89 Future Programmers

This could be done by to many lost packets, or the way you receive and write the downloaded bytes so it would help if you can post your code here so that we can see and help you out.

Mr.M 89 Future Programmers

This will require one of the two,(1) a deep knowledge and understanding of VOIP, with this knowledge you will be able to develop your our SDK or instead of developing an SDK you will just create relevant classes and use it within your app, or
(2) You will need a third party SDK, there are so many SDKs out there, the reason why you need this is because there is a lot of complexity on the project you are trying to develop because it will have to map or be able to use the E212 and other E.tables, the most available SDKs like the Ozeki SDK gives you a free 30 days trial and they come with a source code on how to incorporate it or how to use it within your software, www.ozekisms.com/index.php?owpn=587

Here is another post which I think follows the VOIP because the numbering and mapping is the same so I think it mite help. But I guess you will have to dig more research on your local service providers to see if they did follow this type of mapping. www.codeproject.com/Articles/15299/Send-a-Text-Message-to-a-Cell-Phone-from-a-VB-NET

Mr.M 89 Future Programmers

Are you sure the server you are trying to connect to is up and running? Also the server name are you sure matches with the name you entered? Is the server accessible?

Please try verifying these because the error says the server is not found, it can be one of these things that may result to this.

Mr.M 89 Future Programmers

Does the user have a place where s/he will enter the address or the browser retrieve the URL somewhere? If the user is the one entering the URL then you can simply check the entered address and if its youtube address then instruct WebBrowser to browse to that other address.

Also please capture and post here the error so we can see, also another thing is that before you can start doing anything with WebBrowser you need to start by this code:

  On Error Resume Next

  ' This should solve your problem.
  If WebBrowser1.Url.PathAndQuery.Equals("http://www.youtube.com") Then
 ' MsgBox("You have entered youtube website.")
 WebBrowser1.Navigate("http://www.google.com")
 Else
 ' MsgBox("Other address entered")
 End If

Hope that will answer your question.

Mr.M 89 Future Programmers

Yes thanks, typed that while I was in a hurry.

Mr.M 89 Future Programmers

Use this, its very simple.

 If txtPrice.Text.StartWith(".") Or Char.IsLetter(txtPrice.Text) Then
 ' The entered values are not allowed here, either a user entered a "." Or a user entered a letter from (a-z)

 Else
 ' The user entered allowed values here

 End if

This is very simple. Hope this helps you.

Mr.M 89 Future Programmers

What's the error that is produced if there is any?