What is VB.NET "My" equivalent in C#?

Hi,

In VB.NET there is a keyword called "My" which has a lot of properties collected at it.

Is there any equivalent to this "My" in C#

Thank you.



Answer this question

What is VB.NET "My" equivalent in C#?

  • meta_alucard

    nope. VB.NET My was implemented in .NET 2.0 (and higher perhaps) which has the common functionality in there, to save users time. It's a VB.NET specific feature



  • mrbelk

    Hi all,

    In VB.NET there is a keyword called "My" which has a lot of properties collected at it.

    Is there any equivalent to this "My" in C#

    Thank you.


  • Pavel M.

    No, there is no equivalent in C#, but if you really want to use VB's "My", this page shows how to do it:

    http://msdn2.microsoft.com/en-us/library/ms173136.aspx

    Michael Blome

    Visual C# Documentation Team


  • Ultrawhack

    threads merged. Please do not cross post :-)

  • ilkerrr

    No, but you can reference the VB assembly Microsoft.VisualBasic giving you the members of My, like e.g.

    Microsoft.VisualBasic.Devices.Computer

    You will not have a My namespace, AFAIK you have to browse the namespace directly.

    --
    SvenC


  • What is VB.NET "My" equivalent in C#?