VS 2008 Checking To See If It Can Connect?

Apr 25, 2009

i know My.Computer.Network.Ping but as alot of people know, it's glitchy and bugged.

I want something that checks to see if it can connect with something, as simple as it sounds.

I'm experimenting with sockets at the moment, but having trouble so i thought i would come and ask here

What i'm up to:

VB
IP = Net.IPAddress.Parse(getinfo("settings.inf", i & "IP"))
socket = New Net.Sockets.Socket(Net.Sockets.AddressFamily.InterNetwork, Net.Sockets.SocketType.Stream, Net.Sockets.ProtocolType.IP)

[Code].....

However the problem with this it that i pinged 1.1.1.1 and it still connects, ALSO i would like to be able to check a hostname not just an IP to make things more convenient, please help me to find a way to properly check a connection with IP or hostname.

Note: The getinfo function is defined by me

View 1 Replies


ADVERTISEMENT

Game Programming :: Checking For A Win In Connect Four?

Jun 10, 2009

I've made a connect four game with a control array of command buttons. (0 through 48) It's a 7 x 7 version.

You've got to click a space, a second form pops up with a random question taken from an input file and you've got to answer it correctly. If you do, your space will turn either red or yellow, depending on if you're player 1 or 2.

I've got it all working, but I just cannot figure out the code for winning for the life of me! I know I need to check through with for-loops and all, but I'm dying here. Teacher said somehow incorporate a boolean of some sort, but she's really abandoning us on this project, and it's only my first year.. So I'm kind of new still, I guess.

I need to check vertically, horizontally and diagonally.

View 3 Replies

VS 2005 - Boolean Checking - Better Performance By Checking For A True Value

Aug 4, 2010

Is there any better performance by checking for a true value like this:

[CODE]..............

Than like this:

[CODE]..............

View 5 Replies

VS 2008 Checking How Many '.' There Are In A String

Dec 21, 2011

i have a textbox in a calculator and i want an if function so that it checks that there cannot be 2 .'s in it:[code]

View 2 Replies

VS 2008 Checking If A Registry

Jun 15, 2010

I'm trying to determine the framework version that is installed via the registry. When poking around, I found this key: HKLMSOFTWAREMicrosoft.NETFrameworkPolicyv4.0 I've created the following function to determine if the key exists:

[Code]...

I've verified the key exists, but it keeps returning False.

View 1 Replies

VS 2008 - Checking If Date Variable Is Not Set

Feb 28, 2010

In the following code, a Date variable is declared but not set to anything:
Dim myDate As Date
What's the proper method of checking if the Date variable is "new" and not set to anything?

For example, getting the lowest date value from an array of dates:
Dim dtMostRecent As Date
For i As Intger = 0 To myDateArray.Count - 1
If myDateArray(i) < dtMostRecent Then dtMostRecent = myDateArray(i)
Next

In the code above, I need a way to check first if dtMostRecent is unassigned, in which case just give it the first value, after which it can be compared with subsequent values. How to check if a Date variable is unassigned.

View 5 Replies

VS 2008 - Checking If Process Exists

Jul 19, 2010

I've created the following function and thrown it inside of a timer:

[code]...

It works, but it keeps trying to open media player for each process it looks like. I need to continuously run the function so that Media Player opens when it's closed.how to make sure it opens only once when the process doesn't exist?

View 12 Replies

VS 2008 - Checking The Contents Of A Combobox?

May 16, 2011

Can someone tell me why this code works exactley the opposite of the way I thought it should?

[code]...

I have a combobox (cbKeyWords). I want to make sure tbAddEdit.Text does not already exist before I save. To me I should be testing for a False result not True. But the above code, goes to the msgbox if findstringexact=false and saves the data if it's true.

View 2 Replies

VS 2008 Checking A Color's ARGB Value

Jul 15, 2009

I was curious why this bit of code won�t detect that the ARGB value is Blue:

[Code]...

When I run the code it says that the color isn�t Blue.

View 3 Replies

VS 2008 Checking Checkbox Status?

Apr 15, 2009

I have agroupbox control and on this groupbox control there is upto 10 checkboxes, if any of them are unchecked i was going to throw a warning "No checkboxes selected" i'm not sure how to go about it so far i have:

For Each ctrl As Control In GroupBox10.Controls
'Not sure what to do here...
Next

[code].....

View 4 Replies

VS 2008 Checking For Changed Text?

Sep 20, 2010

I have 22 text boxes that have to be checked to see if the value has changed. I am using the TextChanged Event handler to do this thus:

Private Sub TextStringChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
DataChanged = True
RemoveHandler ........

[code]....

The Handler would be added after the data had been loaded. The question is:Is there another way of checking for text changes without having to add and remove 22 handlers.

View 4 Replies

VS 2008 Checking For Changes Before Closing (HasChanges)?

Apr 3, 2011

I'm having trouble using the HasChanges method.I'm trying to get a message box to show if a user hits the edit button, makes a change, then hits the close button without hitting the save button first. From what I understand, the HasChanges(DataRowState.Modified) statement should work.In reality, when I hit the edit button, make a change to a field (zip for example), then hit the close, it just closes without showing the messagebox.Here's my code so far...

Private Sub CustomerForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) _
Handles Me.FormClosing

[code].....

View 2 Replies

VS 2008 Checking For Existence Of Registry Key?

Jan 6, 2010

I am trying to have my program check for the existence of a registry key so I do not get a null reference exception error. The key may or may not exist depending on the computer. How can I check to see if it exists and then change its value if it does exist or skip over it to the next one if it does not exist? (I already know how to change the value part of it) Im just not sure how to check for the existence of it for example would be trying to set the value of a key that does not exist called test below... this obviously would throw a null exception error so how do I check for the existence of the key before executing these instructions and then if it does not exist it skips this and keeps going to the next code ?

Dim testkey As RegistryKey = Registry.LocalMachine.OpenSubKey("SystemCurrentControlSetTEST", True)
Dim keyval As Int32
' Set to ON
keyval = 1
testkey.SetValue("ON", keyval)

I also check the status of the registry entry on form load

Dim Test As RegistryKey = Registry.LocalMachine.OpenSubKey("SystemCurrentControlSetMYTEST", False)
'Get the reg value.
Dim Testflag As Integer = CInt(Test.GetValue("ON"))

[code]....

View 11 Replies

VS 2008 Checking For Registry Values?

Jan 14, 2010

I have tried to solve this myself and I know I am probably doing something really silly here what I have is two different registry values that control what is displayed in the combobox on my form RegistryKey1 has the following values:0,1 or it does not existRegistryKey2 has the following values2,3, or 4 the combobox has the following values 0,1,2,3 However here is the problem if the RegistryKey2 is 2 then it further has to be checked if RegistryKey1 is either 0,1 or does not exist

if it is 1 then the selectedindex = 0
if it is 0 or does not exist then the selectedindex = 1
if RegistryKey2 is 3 then the selectedindex = 2

[code].....

View 3 Replies

VS 2008 Checking For The Biggest Number

Jan 21, 2010

Suppose I have 5 Integers(A, B, C, D, and E) and 5 Textboxes. When the program run, the user is going to input 5 numbers to those 5 textboxes. When a button is pressed, a label will show up and write the textbox number with the biggest number.

View 1 Replies

VS 2008 Checking Forms Design?

Aug 3, 2009

I'm very green with VB Express 2008 and am going through the tutorial. I'm skipping over a lot of the exercises as some of it is review for me - I've a fairly solid background in MS Access VBA and forms design there. But I have a simple question on VB Express forms design (I'm not worried about data handling or anything yet).How do I test a form? In my first form on my project, I just press F5 (Start debugging) and it opens just fine. However, I'm playing around with a second form in design mode and can't seem to get it to open to test some of the code (simple msgboxes associated with buttons).

In Access 2003 and earlier, there was a design mode and form view. The Access design mode was the equivalent of the design tab in the VB project, but I can't seem to find the equivalent of the Access form view in VB so that I can open that form. VB F5 only seems to open the first form.BTW, is VS 2008 the correct tag/prefix for this question on VB Express 2008? I see there's a separate tag list - is there an approved list of tags aside from the prefix before the title in the posting screen?

View 6 Replies

VS 2008 Checking If A Drive Exists?

Feb 9, 2011

I'm checking is a file exists as follows.

If txtGradeObs.Text = "" Or Dir(txtGradeObs.Text) = "" Then
MsgBox("Specify the Grade job of Obstructions", vbExclamation, MsgBoxTitle)
Exit Sub
End If

I get an error if the drive does not exist - i.e. G: rather than C:. It used to work in VB6. How can I get it to work.

View 4 Replies

VS 2008 Checking If COM Ports Work?

Aug 3, 2010

I want to make a program where I can chose a COM port (For example COM 1), then check if it's working. It would be really useful for me, seeing as I work a lot with broken COM cards.

View 1 Replies

VS 2008 Checking If Listbox1 Has Same Values

Mar 30, 2010

as title says. and if it has the same values, delete one of them and add (2)
so itll be like: - before the filter:

[Code]....

View 4 Replies

VS 2008 Checking If PictureBox1 Contains PictureBox2?

Oct 19, 2011

I have a project in which I turn a picturebox into a bitmap and I want to check if picturebox2 exists within picturebox1. NOT THE SAME IMAGE.Picturebox2 is a smaller image and isnt THE SAME image as picturebox2.For eg.If picturebox1 was The google logo.and if picturebox2 was Now they arn't the same but picturebox1 CONTAINS picturebox2.I want it to be able to check if it exists in picturebox2 and get the COORDS of the location WITHIN picturebox2I have this code so far but don't know how to finish it

Dim bmp As Bitmap = DirectCast(PictureBox1.Image, Bitmap)
Dim bmp1 As Bitmap = DirectCast(PictureBox2.Image, Bitmap)
For x As Integer = 0 To bmp.Width - 1

[code]....

View 8 Replies

VS 2008 Checking Server Services

Jun 6, 2009

I have started to Build my Server Monitoring/Alarm system and I have built all the components that check network connectivity and internet connectivity etc and alarm if anythingis bad.However I am now struggling to find a way that I can check the following local services are running ok:
[code]

View 1 Replies

VS 2008 Checking The Contents Of A Combobox?

Aug 7, 2009

why this code works exactley the opposite of the way I thought it should?

[Code]...

I have a combobox (cbKeyWords). I want to make sure tbAddEdit.Text does not already exist before I save. To me I should be testing for a False result not True. But the above code, goes to the msgbox if findstringexact=false and saves the data if it's true. Am I crazy or am I missing something? Shouldn't FindStringExact return false if it's not found?

View 3 Replies

VS 2008 Preventing The IDE From Checking Things?

Aug 16, 2010

I often face the following problem : when I have a form with lots of controls on it (100 , 200 etc) and I change the name of a control , the IDE goes slow for a few seconds . This is very annoying when I have to change the name to a lot of controls . I believe this is happening because the IDE checks the forms , the code etc to see if there any problem after (re)naming the controls . Of course this is welcome because it prevents a lot of problems , but at the same time it creates some serious problems as well . Thus , I wonder , is there any way I could prevent the IDE from checking all those things in order not to reduce it's speed ? Of course I am talking temporarily . I believe that what I gain by letting it check after every name-changing , I also gain it if I only let it check once (at the end of the name-changing process) .

View 14 Replies

[2008] Checking A Checkbox On A Webbrowser?

Jan 6, 2009

I have a simple question, how would you check a checkbox on a webpage on your webbrowser by pressing a button, like what would the code be?

View 2 Replies

VS 2008 Pop Up Message When User Clicks 'Ok' With Out Checking Something?

Sep 4, 2009

Do something like this

-User Opens program
-User goes to settings.(Settings has a bunch of RadioButtons)
-User Customizes settings, checks certain buttons. (How would I pop up a msg when the user clicks "Ok" with out checking something?
-When "Ok" is pressed, it will "save"
-When settings is opened again, the same RadioButtons will be checked.

Right now, if I exit the settings form, and open it again, the radio buttons are cleared

View 4 Replies

VS 2008 - Checking If A Textbox Is Numeric And 4 Numbers?

Sep 8, 2009

best way to check if a textbox has only 4 numbers and isNumeric, for example i need to enter postcodes.I currently have:

If CDbl(txtPostcode.Text) <> 4 Or Not IsNumeric(txtPostcode) Then
MessageBox.Show("Postcode must be 4 Digits", "Error")

But the message box comes up regardless of whether there is 4 numbers, letters, or anything in the textbox. Its also used in the leave function of the textbox.

View 11 Replies

VS 2008 - Checking If IFrame Exist Or Not In WebBrowser

Mar 14, 2012

I have a program Which can get the frame's content, but if it is iframe I got error, normal frame with no problem, I need to detect the frame is iframe or normal frame.... but fail...

If WebBrowser1.Document IsNot Nothing Then
Dim element = WebBrowser1.Document.GetElementByTagName("iframe")
If element IsNot Nothing Then
checkiframe = True
[Code] .....

View 2 Replies

VS 2008 Checking Internet Connection Code?

May 15, 2012

I have been using the code below to tell if the computer has an internet connection. It works fine on my home computer but when I run it at work on our network which has internet, it fails. I can go to the sites I use below in my browser but when this is run in my app, it returns false. Any ideas why? Is there a better way i should be checking?

[Code]...

View 2 Replies

VS 2008 Checking Thread Completion Before Continuing?

Apr 22, 2012

I'm having trouble checking the completion of multiple threads before executing more code.As an example, I started two threads:

**************************
Dim Thread1 As New System.Threading.Thread(AddressOf wordpress_checker_thread)
Thread1.Start()

[code].....

View 3 Replies

VS 2008 DataGridView - Checking For Null Values

Apr 3, 2009

I have a DataGridView1 populated by sql searches. On the rare occasion that nothing is returned, my app cannot make use of data so I'm trying to check for null values. My code below is not correct because IsDBNull is not a member of the of the DataGridView1.

If DataGridView1.SelectedRows(0).IsDBNull Then
MsgBox("Nothing to display")
Exit Sub
End If

View 3 Replies







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