'My' in Vb.net

in VB.net we can write 'My' in our code

like My.Network

My.Computer

what can we use equal that in C#




Answer this question

'My' in Vb.net

  • cica

    this is the first time here

    so i wish u will help me,

    i wanna use the My class or keyword in my project using vb.net 1.1 but i couldn't it always show me an error, also there is no reference for microsoft.visualbasic.devices in my references ,,,,,plz help me i wanna use it to make ping application

    thanx alot



  • Walter Sobchak

    can you write code snippet explaining how to use My in C#

  • Cliff Buckley

    this, the this keyword.


  • SteffenK

    well .. as Vb u can use it by adding Microsoft Visual Basic.dll as a reference , in the code write the following :

    using Microsoft.VisualBasic.Devices;

    ..

    then in the main code u can use it like

    Audio myAud = new Audio();

    myAud.Play(@"C:\WINDOWS\Media\Windows XP Startup.wav");

    .

    .have a nice day .. and take care of hamza



  • Vallari Kamble - MSFT

    Actually, you can use "My". It is available in the Microsoft.VisualBasic namespace.
  • Josh Ledgard

    Dammit, readed wrong. Thought you want the Me keyword in C#, sorry for that.

    My in VB.NET is a language future, just some fancy stuff. So there is not such thing in C# or other .NET Language. But My only provide some syntax candy, everything you can do the the My future in VB.NET can be done with using the .NET Framework classes.


  • teneriffebogan

    Dear faty

    we were talking about My in Vb.net 2005

    not in 1.1

    but i want to help you so check this link

    Hope it helps



  • Trickie_GROUP

  • m3rch

    Here you can find the MSDN Reference about it:
    http://msdn2.microsoft.com/en-us/library/dk1507sz.aspx


  • 'My' in Vb.net