Click here to Skip to main content
15,888,803 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Index was outside the bounds of the array Pin
Richard MacCutchan12-Oct-12 21:07
mveRichard MacCutchan12-Oct-12 21:07 
QuestionConfused by my own code: LINQ FirstOrDefault Pin
Steven St. John11-Oct-12 13:18
Steven St. John11-Oct-12 13:18 
AnswerRe: Confused by my own code: LINQ FirstOrDefault Pin
Steven St. John16-Oct-12 6:58
Steven St. John16-Oct-12 6:58 
QuestionVB.NET Parameters error Pin
Diego Carrion11-Oct-12 4:12
Diego Carrion11-Oct-12 4:12 
AnswerRe: VB.NET Parameters error Pin
Simon_Whale11-Oct-12 4:45
Simon_Whale11-Oct-12 4:45 
GeneralRe: VB.NET Parameters error Pin
Diego Carrion11-Oct-12 4:47
Diego Carrion11-Oct-12 4:47 
GeneralRe: VB.NET Parameters error Pin
ChandraRam11-Oct-12 11:06
ChandraRam11-Oct-12 11:06 
QuestionSlow Ping and not guaranteed success Pin
Herboren10-Oct-12 5:44
Herboren10-Oct-12 5:44 
I work for an ISP strictly for small business and minimal residential. We provide different services as well as web hosting. We have to convert web domains to an IP once a month from a list.

I am trying to recreate an app in VB.net and it takes forever for ping result to come back as true or flase and when I transl;ate the host into an IP it doesnt get an IP for the host even though it exists. Here is a sample picture of my compiled app running:

http://postimg.com/87000/what-86552.jpg[^]

my code in vb.net:

VB
Imports System
Imports System.Net
Imports System.IO


Public Class Form1
    Dim reachable As Boolean = False
    Dim IPEntry As IPHostEntry
    Dim ReadAllLinesArray() As String




    Public Function IsDestinationRechable(ByVal hostOrAddress As String)
        Try
            reachable = My.Computer.Network.Ping(hostOrAddress)
        Catch pingException As System.Net.NetworkInformation.PingException
        Catch genericNetworkException As System.Net.NetworkInformation.NetworkInformationException
            'Fail silently and return false
        End Try
        Return reachable
    End Function

    Public Sub GetPingAndIPv4()
        Try

            For Each s As String In ReadAllLinesArray
                Try
                    IPEntry = Dns.GetHostByName(s)
                    If IsDestinationRechable(IPEntry.AddressList(0).ToString) = True Then
                        Dim lsv As ListViewItem = lsvHostItemList.Items.Add(s)
                        lsv.SubItems.Add(IPEntry.AddressList(0).ToString)
                        lsv.SubItems.Add(IsDestinationRechable(reachable))
                       
                        tssProgressBar.PerformStep()
                    Else
                        Dim lsv As ListViewItem = lsvHostItemList.Items.Add(s)
                        lsv.SubItems.Add("n/a")
                        lsv.SubItems.Add(IsDestinationRechable(reachable))
                        tssProgressBar.PerformStep()
                    End If
                Catch ex As Exception
                End Try
            Next

        Catch ex As Exception

        End Try
    End Sub

    Private Sub OpenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OpenToolStripMenuItem.Click
        If OpenOldHostsFile.ShowDialog = Windows.Forms.DialogResult.OK Then
            ReadAllLinesArray = File.ReadAllLines(OpenOldHostsFile.FileName)
            tssProgressBar.Maximum = ReadAllLinesArray.Count
        End If
    End Sub

    Private Sub SaveToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SaveToolStripMenuItem.Click
        If SaveNewHostsFile.ShowDialog = Windows.Forms.DialogResult.OK Then

        End If
    End Sub

    Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
        End
    End Sub

    Private Sub RunToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles RunToolStripMenuItem1.Click
        GetPingAndIPv4()
    End Sub


My code isn't complete I am trying to get the main functionality working correctly first.
AnswerRe: Slow Ping and not guaranteed success Pin
Dave Kreskowiak10-Oct-12 8:13
mveDave Kreskowiak10-Oct-12 8:13 
GeneralRe: Slow Ping and not guaranteed success Pin
Herboren10-Oct-12 11:33
Herboren10-Oct-12 11:33 
GeneralRe: Slow Ping and not guaranteed success Pin
Dave Kreskowiak10-Oct-12 13:01
mveDave Kreskowiak10-Oct-12 13:01 
GeneralRe: Slow Ping and not guaranteed success Pin
Herboren10-Oct-12 16:20
Herboren10-Oct-12 16:20 
GeneralRe: Slow Ping and not guaranteed success Pin
Dave Kreskowiak10-Oct-12 23:50
mveDave Kreskowiak10-Oct-12 23:50 
GeneralRe: Slow Ping and not guaranteed success Pin
Eddy Vluggen15-Oct-12 1:19
professionalEddy Vluggen15-Oct-12 1:19 
QuestionFunction Not Found From Dll Component Pin
AmbiguousName10-Oct-12 1:57
AmbiguousName10-Oct-12 1:57 
AnswerRe: Function Not Found From Dll Component Pin
Eddy Vluggen11-Oct-12 0:08
professionalEddy Vluggen11-Oct-12 0:08 
GeneralRe: Function Not Found From Dll Component Pin
AmbiguousName12-Oct-12 1:07
AmbiguousName12-Oct-12 1:07 
GeneralRe: Function Not Found From Dll Component Pin
Eddy Vluggen12-Oct-12 1:25
professionalEddy Vluggen12-Oct-12 1:25 
GeneralRe: Function Not Found From Dll Component Pin
AmbiguousName12-Oct-12 1:54
AmbiguousName12-Oct-12 1:54 
GeneralRe: Function Not Found From Dll Component Pin
Eddy Vluggen12-Oct-12 2:10
professionalEddy Vluggen12-Oct-12 2:10 
QuestionBlank Asp webpage. Pin
miss7868-Oct-12 0:08
miss7868-Oct-12 0:08 
AnswerRe: Blank Asp webpage. Pin
Cloud Cray8-Oct-12 7:49
Cloud Cray8-Oct-12 7:49 
GeneralRe: Blank Asp webpage. Pin
miss7869-Oct-12 1:14
miss7869-Oct-12 1:14 
GeneralRe: Blank Asp webpage. Pin
Dave Kreskowiak9-Oct-12 1:51
mveDave Kreskowiak9-Oct-12 1:51 
GeneralRe: Blank Asp webpage. Pin
Dave Kreskowiak9-Oct-12 1:55
mveDave Kreskowiak9-Oct-12 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.