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
Juval Lowy ported My as That in C# as an interim solution. Don't ask me why...
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.
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 .
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.
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.
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...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With