Click here to Skip to main content
15,914,010 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: probelm on Reading txt file..?? Pin
campbells21-Mar-06 22:16
campbells21-Mar-06 22:16 
GeneralRe: probelm on Reading txt file..?? Pin
Dave Kreskowiak22-Mar-06 3:37
mveDave Kreskowiak22-Mar-06 3:37 
GeneralRe: probelm on Reading txt file..?? Pin
campbells24-Mar-06 21:46
campbells24-Mar-06 21:46 
GeneralRe: probelm on Reading txt file..?? Pin
Dave Kreskowiak25-Mar-06 2:38
mveDave Kreskowiak25-Mar-06 2:38 
GeneralRe: probelm on Reading txt file..?? Pin
campbells25-Mar-06 5:37
campbells25-Mar-06 5:37 
GeneralRe: probelm on Reading txt file..?? Pin
campbells27-Mar-06 2:11
campbells27-Mar-06 2:11 
GeneralRe: probelm on Reading txt file..?? Pin
Dave Kreskowiak27-Mar-06 17:02
mveDave Kreskowiak27-Mar-06 17:02 
QuestionIP address from TCPClient Pin
Polymorpher20-Mar-06 12:46
Polymorpher20-Mar-06 12:46 
sombody was asking about how to do this before and i cant remember where they posted, but i know it was for vb.net so here is the code to get the IP address and port from a TCPClient...ideas came from some other posts on this sight and where modified to work with VB instead of C# and i also added the AddressInfo class...hope this helps someone
=============================================================================

Imports System.Net
Imports System.Net.Sockets
Imports System.Reflection

Public Class NetworkUtils

Public Const kLineEnd = 10

#Region "AddressInfo"
Public Class AddressInfo
Private m_IP As String
Private m_Port As String

Public Sub New()
m_IP = MyIP()
m_Port = "999"
End Sub

Public Sub New(ByVal theIP As String, ByVal thePort As String)
m_IP = theIP
m_Port = thePort
End Sub

Public ReadOnly Property IP() As String
Get
Return m_IP
End Get
End Property

Public ReadOnly Property Port() As String
Get
Return m_Port
End Get
End Property
End Class
#End Region

Public Shared Function AddressInfoFromTCPClient(ByRef theClient As TcpClient) As AddressInfo
Dim theAddress() As String = CType(theClient.GetStream.GetType.GetProperty("Socket", BindingFlags.NonPublic Or BindingFlags.Instance).GetValue(theClient.GetStream, Nothing), Socket).RemoteEndPoint.ToString.Split(":")
Return New AddressInfo(theAddress(0), theAddress(1))
End Function

Public Shared Function MyIP() As String
Return System.Net.Dns.Resolve(System.Net.Dns.GetHostName).AddressList(0).ToString
End Function
End Class

Pablo
AnswerRe: IP address from TCPClient Pin
Dave Kreskowiak20-Mar-06 19:03
mveDave Kreskowiak20-Mar-06 19:03 
Questiontry/catch block usage Pin
spoodygoon20-Mar-06 11:42
spoodygoon20-Mar-06 11:42 
AnswerRe: try/catch block usage Pin
Steve Pullan20-Mar-06 12:22
Steve Pullan20-Mar-06 12:22 
AnswerRe: try/catch block usage Pin
HimaBindu Vejella20-Mar-06 18:41
HimaBindu Vejella20-Mar-06 18:41 
QuestionModem/Adsl status Pin
FeRtoll20-Mar-06 11:24
FeRtoll20-Mar-06 11:24 
QuestionMemory issue Pin
luciodandrea20-Mar-06 6:49
luciodandrea20-Mar-06 6:49 
AnswerRe: Memory issue Pin
CWIZO20-Mar-06 7:49
CWIZO20-Mar-06 7:49 
AnswerRe: Memory issue Pin
Dave Kreskowiak20-Mar-06 9:37
mveDave Kreskowiak20-Mar-06 9:37 
GeneralRe: Memory issue Pin
luciodandrea21-Mar-06 3:06
luciodandrea21-Mar-06 3:06 
Questionclick button bold Pin
zabsmarty20-Mar-06 5:56
zabsmarty20-Mar-06 5:56 
AnswerRe: click button bold Pin
Roy Heil20-Mar-06 6:34
professionalRoy Heil20-Mar-06 6:34 
Questionidea for new IDE Pin
zabsmarty20-Mar-06 5:54
zabsmarty20-Mar-06 5:54 
AnswerRe: idea for new IDE Pin
CWIZO20-Mar-06 6:49
CWIZO20-Mar-06 6:49 
AnswerRe: idea for new IDE Pin
Guerven20-Mar-06 17:32
Guerven20-Mar-06 17:32 
AnswerRe: idea for new IDE Pin
Christian Graus20-Mar-06 17:42
protectorChristian Graus20-Mar-06 17:42 
GeneralRe: idea for new IDE Pin
Paul Conrad25-Mar-06 14:49
professionalPaul Conrad25-Mar-06 14:49 
Questionprogrammatically create a csv file????? Pin
scottstarbuck20-Mar-06 5:03
scottstarbuck20-Mar-06 5:03 

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.