C# To VB.NET Translation

Posted on 2006-05-30
Last Modified: 2012-08-13
Udpclient is a .net object
IPEndPoint is a .net object
UDPState is a class
ar.asyncstate is just a async operation that holds something or i have no clue

UdpClient u = (UdpClient)((UdpState)(ar.AsyncState)).u;
IPEndPoint e = (IPEndPoint)((UdpState)(ar.AsyncState)).e;

Dim arUDPClient As UdpClient = CType(CType(ar.AsyncState, StateObject), UdpClient)
Dim arIPEndPoint As IPEndPoint = CType(ar.AsyncState, IPEndPoint)

Please help me translate from C# to VB.NET
Question by:Hepen
    1 Comment
    LVL 37

    Accepted Solution

    Dim arUDPClient As UdpClient = CType(CType(ar.AsyncState, StateObject).u, UdpClient)
    Dim arIPEndPoint As IPEndPoint = CType(CType(UdpState(ar.AsyncState).e, IPEndPoint)

    I think that'll do it .. just typed in in here quick but should be alright.


    Greg Young
    MVP - C#

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now