Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
AnasayfaAnasayfa  Latest imagesLatest images  Kayıt OlKayıt Ol  Giriş yapGiriş yap  

 

 IP Doğrulama...

Aşağa gitmek 
YazarMesaj
Apocalypse
Genelkurmay Başkanı
Genelkurmay Başkanı
Apocalypse


Erkek Mesaj Sayısı : 411
Yaş : 31
Nerden : Ms-Dos
Kayıt tarihi : 20/02/09

IP Doğrulama... Empty
MesajKonu: IP Doğrulama...   IP Doğrulama... EmptyPaz Şub. 22, 2009 1:49 am

IP Doğrulama...

--------------------------------------------------------------------------------

'Projenize 1 adet metin kutusu ve bir adet buton ekleyin

Public Function Valid_IP(IP As String) As Boolean
Dim i As Integer
Dim dot_count As Integer
Dim test_octet As String
Dim byte_check
IP = Trim$(IP)

' make sure the IP long enough before
' continuing
If Len(IP) < 8 Then
Valid_IP = False
'Show Message
MsgBox IP & " is Invalid", , "IP Validator"
Exit Function
End If

i = 1
dot_count = 0
For i = 1 To Len(IP)
If Mid$(IP, i, 1) = "." Then
' increment the dot count and
' clear the test octet variable
dot_count = dot_count + 1
test_octet = ""
If i = Len(IP) Then
' we've ended with a dot
' this is not good
Valid_IP = False
'Show Message
MsgBox IP & " is Invalid", , "IP Validator"
Exit Function
End If
Else
test_octet = test_octet & Mid$(IP, i, 1)
On Error Resume Next
byte_check = CByte(test_octet)
If (Err) Then
' either the value is not numeric
' or exceeds the range of the byte
' data type.
Valid_IP = False
Exit Function
End If
End If
Next i
' so far, so good
' did we get the correct number of dots?
If dot_count <> 3 Then
Valid_IP = False
Exit Function
End If
' we have a valid IP format!
Valid_IP = True
'Show Message
MsgBox IP & " is Valid", , "IP Validator"

End Function

Private Sub Command1_Click()
If Len(Text1) = 0 Then
MsgBox "Please type an IP Address in the textbox.", , "IP Validator"
Else
'Call the Function
Valid_IP Text1
End If
End Sub
Sayfa başına dön Aşağa gitmek
 
IP Doğrulama...
Sayfa başına dön 
1 sayfadaki 1 sayfası

Bu forumun müsaadesi var:Bu forumdaki mesajlara cevap veremezsiniz
 :: Programlama :: C#j#vb.net (.Net Dilleri)-
Buraya geçin:  
Copyright © Osmanlı Tim
Osmanlı Güvenlik || The Ottoman Security
Developed By CeMRe-eX || The Labrador
forum kurmak | Bilişim ve Internet | Computers | ©phpBB | Bedava yardımlaşma forumu | Suistimalı göstermek | Son tartışmalar