Click here to Skip to main content
11,438,069 members (48,038 online)

Visual Basic

 
AnswerRe: Index was outside the bounds of the array Pin
Richard MacCutchan12-Oct-12 22:07
mvpRichard MacCutchan12-Oct-12 22:07 
QuestionConfused by my own code: LINQ FirstOrDefault Pin
Steven St. John11-Oct-12 14:18
memberSteven St. John11-Oct-12 14:18 
AnswerRe: Confused by my own code: LINQ FirstOrDefault Pin
Steven St. John16-Oct-12 7:58
memberSteven St. John16-Oct-12 7:58 
QuestionVB.NET Parameters error Pin
Diego Carrion11-Oct-12 5:12
memberDiego Carrion11-Oct-12 5:12 
AnswerRe: VB.NET Parameters error Pin
Simon_Whale11-Oct-12 5:45
memberSimon_Whale11-Oct-12 5:45 
GeneralRe: VB.NET Parameters error Pin
Diego Carrion11-Oct-12 5:47
memberDiego Carrion11-Oct-12 5:47 
GeneralRe: VB.NET Parameters error Pin
ChandraRam11-Oct-12 12:06
memberChandraRam11-Oct-12 12:06 
QuestionSlow Ping and not guaranteed success Pin
Herboren10-Oct-12 6:44
memberHerboren10-Oct-12 6: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:

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 9:13
mvpDave Kreskowiak10-Oct-12 9:13 
GeneralRe: Slow Ping and not guaranteed success Pin
Herboren10-Oct-12 12:33
memberHerboren10-Oct-12 12:33 
GeneralRe: Slow Ping and not guaranteed success Pin
Dave Kreskowiak10-Oct-12 14:01
mvpDave Kreskowiak10-Oct-12 14:01 
GeneralRe: Slow Ping and not guaranteed success Pin
Herboren10-Oct-12 17:20
memberHerboren10-Oct-12 17:20 
GeneralRe: Slow Ping and not guaranteed success Pin
Dave Kreskowiak11-Oct-12 0:50
mvpDave Kreskowiak11-Oct-12 0:50 
GeneralRe: Slow Ping and not guaranteed success Pin
Eddy Vluggen15-Oct-12 2:19
memberEddy Vluggen15-Oct-12 2:19 
QuestionFunction Not Found From Dll Component Pin
AmbiguousName10-Oct-12 2:57
memberAmbiguousName10-Oct-12 2:57 
AnswerRe: Function Not Found From Dll Component Pin
Eddy Vluggen11-Oct-12 1:08
memberEddy Vluggen11-Oct-12 1:08 
GeneralRe: Function Not Found From Dll Component Pin
AmbiguousName12-Oct-12 2:07
memberAmbiguousName12-Oct-12 2:07 
GeneralRe: Function Not Found From Dll Component Pin
Eddy Vluggen12-Oct-12 2:25
memberEddy Vluggen12-Oct-12 2:25 
GeneralRe: Function Not Found From Dll Component Pin
AmbiguousName12-Oct-12 2:54
memberAmbiguousName12-Oct-12 2:54 
GeneralRe: Function Not Found From Dll Component Pin
Eddy Vluggen12-Oct-12 3:10
memberEddy Vluggen12-Oct-12 3:10 
QuestionBlank Asp webpage. Pin
Member 94936398-Oct-12 1:08
memberMember 94936398-Oct-12 1:08 
AnswerRe: Blank Asp webpage. Pin
Cloud Cray8-Oct-12 8:49
memberCloud Cray8-Oct-12 8:49 
GeneralRe: Blank Asp webpage. Pin
miss7869-Oct-12 2:14
membermiss7869-Oct-12 2:14 
GeneralRe: Blank Asp webpage. Pin
Dave Kreskowiak9-Oct-12 2:51
mvpDave Kreskowiak9-Oct-12 2:51 
GeneralRe: Blank Asp webpage. Pin
Dave Kreskowiak9-Oct-12 2:55
mvpDave Kreskowiak9-Oct-12 2:55 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150506.1 | Last Updated 6 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid