Click here to Skip to main content
15,886,873 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How can I show a text on mouseover over an image in vb.net? Pin
waner michaud31-Mar-10 7:44
waner michaud31-Mar-10 7:44 
AnswerRe: How can I show a text on mouseover over an image in vb.net? Pin
The Man from U.N.C.L.E.31-Mar-10 7:04
The Man from U.N.C.L.E.31-Mar-10 7:04 
GeneralRe: How can I show a text on mouseover over an image in vb.net? Pin
waner michaud31-Mar-10 7:44
waner michaud31-Mar-10 7:44 
QuestionPocket Pc In VB.Net Pin
ejaz_pk31-Mar-10 2:42
ejaz_pk31-Mar-10 2:42 
AnswerRe: Pocket Pc In VB.Net Pin
Eddy Vluggen31-Mar-10 13:29
professionalEddy Vluggen31-Mar-10 13:29 
QuestionSOAP Toolkit 3.0 Formatting question Pin
ffowler31-Mar-10 1:58
ffowler31-Mar-10 1:58 
QuestionHow can I receive data from specific ip and UDP port ? Pin
sujit chourasia31-Mar-10 0:50
sujit chourasia31-Mar-10 0:50 
AnswerRe: How can I receive data from specific ip and UDP port ? Pin
DaveAuld31-Mar-10 1:05
professionalDaveAuld31-Mar-10 1:05 
Simply use the network classes to open up a connection on that port and start to receive the network stream.

Here is the example from MSDN using the TCPClient class;

VB.NET
Shared Sub Connect(server As [String], message As [String])
   Try
      ' Create a TcpClient.
      ' Note, for this client to work you need to have a TcpServer 
      ' connected to the same address as specified by the server, port
      ' combination.
      Dim port As Int32 = 13000
      Dim client As New TcpClient(server, port)

      ' Translate the passed message into ASCII and store it as a Byte array.
      Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes(message)

      ' Get a client stream for reading and writing.
      '  Stream stream = client.GetStream();
      Dim stream As NetworkStream = client.GetStream()

      ' Send the message to the connected TcpServer. 
      stream.Write(data, 0, data.Length)

      Console.WriteLine("Sent: {0}", message)

      ' Receive the TcpServer.response.
      ' Buffer to store the response bytes.
      data = New [Byte](256) {}

      ' String to store the response ASCII representation.
      Dim responseData As [String] = [String].Empty

      ' Read the first batch of the TcpServer response bytes.
      Dim bytes As Int32 = stream.Read(data, 0, data.Length)
      responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes)
      Console.WriteLine("Received: {0}", responseData)

      ' Close everything.
      stream.Close()
      client.Close()
   Catch e As ArgumentNullException
      Console.WriteLine("ArgumentNullException: {0}", e)
   Catch e As SocketException
      Console.WriteLine("SocketException: {0}", e)
   End Try

   Console.WriteLine(ControlChars.Cr + " Press Enter to continue...")
   Console.Read()
End Sub 'Connect


And an example using the UDPClient class;
VB.NET
Dim udpClient As New UdpClient(11000)
  Try
     udpClient.Connect("www.contoso.com", 11000)

     ' Sends a message to the host to which you have connected.
     Dim sendBytes As [Byte]() = Encoding.ASCII.GetBytes("Is anybody there?")

     udpClient.Send(sendBytes, sendBytes.Length)

     ' Sends message to a different host using optional hostname and port parameters.
     Dim udpClientB As New UdpClient()
     udpClientB.Send(sendBytes, sendBytes.Length, "AlternateHostMachineName", 11000)

     ' IPEndPoint object will allow us to read datagrams sent from any source.
     Dim RemoteIpEndPoint As New IPEndPoint(IPAddress.Any, 0)

     ' UdpClient.Receive blocks until a message is received from a remote host.
     Dim receiveBytes As [Byte]() = udpClient.Receive(RemoteIpEndPoint)
     Dim returnData As String = Encoding.ASCII.GetString(receiveBytes)

     ' Which one of these two hosts responded?
     Console.WriteLine(("This is the message you received " + _
                                   returnData.ToString()))
      Console.WriteLine(("This message was sent from " + _
                                   RemoteIpEndPoint.Address.ToString() + _
                                   " on their port number " + _
                                   RemoteIpEndPoint.Port.ToString()))
     udpClient.Close()
     udpClientB.Close()

  Catch e As Exception
     Console.WriteLine(e.ToString())
  End Try

Dave

Don't forget to rate messages!
Find Me On: Web|Facebook|Twitter|LinkedIn
Waving? dave.m.auld[at]googlewave.com


Questiondatagridview button column - text not displaying [Solved] Pin
Simon_Whale30-Mar-10 23:30
Simon_Whale30-Mar-10 23:30 
AnswerRe: datagridview button column - text not displaying Pin
Eddy Vluggen30-Mar-10 23:44
professionalEddy Vluggen30-Mar-10 23:44 
GeneralRe: datagridview button column - text not displaying Pin
Simon_Whale30-Mar-10 23:49
Simon_Whale30-Mar-10 23:49 
GeneralRe: datagridview button column - text not displaying Pin
Eddy Vluggen31-Mar-10 0:21
professionalEddy Vluggen31-Mar-10 0:21 
GeneralRe: datagridview button column - text not displaying Pin
Simon_Whale31-Mar-10 0:27
Simon_Whale31-Mar-10 0:27 
GeneralRe: datagridview button column - text not displaying Pin
Eddy Vluggen31-Mar-10 0:58
professionalEddy Vluggen31-Mar-10 0:58 
GeneralRe: datagridview button column - text not displaying Pin
Simon_Whale31-Mar-10 1:00
Simon_Whale31-Mar-10 1:00 
GeneralRe: datagridview button column - text not displaying Pin
Simon_Whale31-Mar-10 1:09
Simon_Whale31-Mar-10 1:09 
GeneralRe: datagridview button column - text not displaying Pin
Eddy Vluggen31-Mar-10 1:29
professionalEddy Vluggen31-Mar-10 1:29 
AnswerWhat was the solution ? [Got it] Pin
David Mujica13-Jul-10 3:57
David Mujica13-Jul-10 3:57 
GeneralRe: What was the solution ? Pin
Simon_Whale13-Jul-10 4:04
Simon_Whale13-Jul-10 4:04 
GeneralRe: What was the solution ? Pin
David Mujica13-Jul-10 4:05
David Mujica13-Jul-10 4:05 
GeneralRe: What was the solution ? Pin
HomeSen5-Aug-10 23:17
HomeSen5-Aug-10 23:17 
GeneralRe: What was the solution ? Pin
Bob Stanneveld30-Sep-11 9:20
Bob Stanneveld30-Sep-11 9:20 
AnswerRe: datagridview button column - text not displaying [Solved] Pin
Ajit Yagnesh23-Feb-11 1:38
Ajit Yagnesh23-Feb-11 1:38 
GeneralRe: datagridview button column - text not displaying [Solved] Pin
Simon_Whale23-Feb-11 1:40
Simon_Whale23-Feb-11 1:40 
QuestionOffice interop printing problem Pin
mSh198530-Mar-10 22:06
mSh198530-Mar-10 22:06 

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.