473,799 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IPv6 and Visual Basic program how to convert? Help..

I've got a program that wil convert an IP address to decimal.

Anyone give me any infor on how I would modify this program that I had
converting regular IPs to decimal, hwo would I make it work for an IPv6
address? Would I add just 8 instances of converting ?

Thanks for any help....

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

If TextBox1.Text Like "*[!0-9]*" Then

TextBox1.Text = ""

Exit Sub

ElseIf TextBox1.Text = "" Then

Exit Sub

Else

End If

If TextBox2.Text Like "*[!0-9]*" Then

TextBox2.Text = ""

Exit Sub

ElseIf TextBox2.Text = "" Then

Exit Sub

Else

End If

If TextBox3.Text Like "*[!0-9]*" Then

TextBox3.Text = ""

Exit Sub

ElseIf TextBox3.Text = "" Then

Exit Sub

Else

End If

If TextBox4.Text Like "*[!0-9]*" Then

TextBox4.Text = ""

Exit Sub

ElseIf TextBox4.Text = "" Then

Exit Sub

Else

End If

'Below converts 1st octet

Dim ip As Int32

If IsNumeric(TextB ox1.Text) Then

ip = TextBox1.Text

Dim n As Int16

Do

n = ip Mod 2

Label1.Text = n

ip \= 2

Loop Until ip = 0

End If

'Below converts 2nd octet

Dim ip2 As Int32

If IsNumeric(TextB ox2.Text) Then

ip2 = TextBox2.Text

Dim n2 As Int16

Do

n2 = ip2 Mod 2

Label2.Text = n2

ip2 \= 2

Loop Until ip2 = 0

End If

'Below converts 3rd octet

Dim ip3 As Int32

If IsNumeric(TextB ox3.Text) Then

ip3 = TextBox3.Text

Dim n3 As Int16

Do

n3 = ip3 Mod 2

Label3.Text = n3

ip3 \= 2

Loop Until ip3 = 0

End If

'Below converts 4th octet

Dim ip4 As Int32

If IsNumeric(TextB ox4.Text) Then

ip4 = TextBox4.Text

Dim n4 As Int16

Do

n4 = ip4 Mod 2

Label4.Text = n4

ip4 \= 2

Loop Until ip4 = 0

End If

End Sub

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click

Label1.Text = ""

Label2.Text = ""

Label3.Text = ""

Label4.Text = ""

End Sub

End Class
Dec 2 '05 #1
0 1312

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
50593
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork = WScript.CreateObject("WScript.Network") sPwd = inputbox("Enter password") WshNetwork.MapNetworkDrive "J:", "\\server1\data", false, "xyz_net\John", sPwd Msgbox "Drives has been map successful"
3
3820
by: Skumar | last post by:
Hi, Please any one help me, Simple tcp/ip program in c with IPV6 address family Advance thanks, Skumar.
2
3028
by: gregory_may | last post by:
First the research links: IPv6 spec (look for 'jumbo payload'): http://www.cs-ipv6.lancs.ac.uk/ipv6/documents/rfcs/archive/rfc1883.txt IPv6 Sample C# Client/Server http://www.codeproject.com/csharp/ipv6.asp I am developing an application where I need to broadcast information to clients. I have hit a 64K limit in UDP broadcasting. I am not exited
0
1421
by: Addam | last post by:
Anyone, I am writting a server that accepts a list of IPv4 and IPv6 address. The IPv4 address are padded with leading zeros. I belive this allows me to just point to the beging and run both IPv4 addresses and IPv6 address though the same conversion function. However, i am having a hard time finding a simple way to this. I do not want to communicate with the addresses so i would like to avoid setting up anything extra. So does anyone...
2
9280
by: linuxer | last post by:
Hello all, I have the following program, which will take ipv4 address as input in command line and convert it from host byte order to network byte order. I need similar thing to be done for IPv6. Any help is appriciated. Thanks in advance. #include <stdio.h> main( int argc, char *argv ) { unsigned int ip, b1, b2, b3, b4;
2
2049
by: cychong | last post by:
Hi, There is no probleming in programming the basic IPv6 socket program with the python. Then how about the IPv6 extension header? The RFC 2292 and man pages from the unix/linux advise to use the sendmsg to send the packet with the extension header. Does python support the extension header processing? Googling told me that there is no one to try this one with the
1
2911
by: chrspta | last post by:
I am new to Visual basic. I need a program using VB6 that converts txt files to excel file.Description is in the below: The form should have the Drive list, Dir list, file list and cmdConvert button. Once pulling down the drive list and clicking to the specific drive, folders will be shown in the dir list. When clicking the folders in the dir list, files in that certain folder should apprear in the file list, but this program should limit...
2
3727
by: Prabhu Gurumurthy | last post by:
Hello list, I would like to parse IPv6 addresses and subnet using re module in python. I am able to either parse the ipv6 address or ipv6 network but not both using single line. any help appreciated. BTW is there a metacharacter for hex digits. Thanks Prabhu -
14
9300
by: Simon | last post by:
Hi, is there a straight forward way of converting IPv4 to IPv6? I thought that it was just a matter of converting 32 bits to 128 bits, (by adding 96 leading 0s), but that does not seem right in some/most cases. For example, 127.0.0.1, (IPv4 localhost), does not convert ::1, (IPv6 localhost)
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.