Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the documentation for My feature in VB.Net?

No I'm not being a wise guy ...

For those fortunate enough to not know the My class: It's something that was added in VB 2005 (and doesn't exist in C#) and is best described as a 'speeddial for the .net framework'. Supposed to make life easier for newbies who won't read which framework classes they should be using

Dim contents As String
contents = My.Computer.FileSystem.ReadAllText("c:\mytextfile.txt")

Instead of this:

Dim contents As String
contents = IO.File.ReadAllText("c:\mytextfile.txt")

My Question: Where is the MSDN documentation page for which speeddial button maps to what.. ?
By choosing the name of the feature as My - they've just made searching a whole lot more fun that it needs to be. I need to code in C# and can't bear the fun of translating the training/how-to office prog videos which exclusively deal in VB.

More on this from the Dans

  • http://msdn.microsoft.com/en-us/magazine/cc163972.aspx
  • http://blogs.msdn.com/danielfe/archive/2005/06/14/429092.aspx

Juval Lowy ported My as That in C# as an interim solution. Don't ask me why...

like image 252
Gishu Avatar asked Oct 22 '08 10:10

Gishu


People also ask

What is my in Visual Basic?

The My feature provides easy and intuitive access to a number of . NET Framework classes, enabling the Visual Basic user to interact with the computer, application, settings, resources, and so on.

What is VB.NET and its features?

NET (VB.NET) is an object-oriented computer programming language implemented on the . NET Framework. Although it is an evolution of classic Visual Basic language, it is not backwards-compatible with VB6, and any code written in the old version does not compile under VB.NET. Like all other .

Is VB6 and VB.NET same?

VB6 was interpreter based language while VB.NET is a compiled language. VB6 is non-object oriented principle based language. Whereas, VB.NET , from a coding style perspective looks similar to old VB6, but, has more power to it, just because it sits on the . Net platform.


2 Answers

It's the "My namespace" rather than the "My class" which may aid searching.

So far I've found this: http://msdn.microsoft.com/en-us/vbasic/ms789188.aspx but it's not ideal. Looking for more...

EDIT: I think "Developing with My" is effectively the root of the documentation.

like image 150
Jon Skeet Avatar answered Nov 09 '22 04:11

Jon Skeet


The official reference for the My namespace can be found here on MSDN.

Unfortunately, it doesn't describe which 'real' Framework features the My shortcuts map to (although this isn't too hard to figure out in most cases).

As a further annoyance, the source code isn't released as part of the .NET Reference Source either (same situation as with Microsoft.VisualBasic, even though being able to check the source would do a lot to demystify this part of the Framework...)

like image 30
mdb Avatar answered Nov 09 '22 04:11

mdb