• 0

My, Oh My, Oh My !


Question

I have just been playing around with VB Express Beta 1, the new MY class look outstanding, its gonna make so many tedious tasks easy, take a look at the follow examples I found in the MY class.

Play a Sound File

My.Computer.Audio.Play("C:\Waterfall.wav", AudioPlayMode.WaitToComplete)

Read and write to the clipboard

MsgBox(My.Computer.Clipboard.GetText())

My.Computer.Clipboard.SetText("This is a test string.")

Create a Directory

My.Computer.FileSystem.CreateDirectory ("C:\Documents and Settings\All Users\Documents\NewDirectory")

Move a Directory

My.Computer.FileSystem.MoveDirectory("C:\Directory1", "C:\Directory2")

Check a Connection

If My.Computer.Network.IsAvailable = True Then
 ? ?MsgBox("Computer is connected.")
Else ?
 ? ?MsgBox("Computer is not connected.")
End If

Create a Registry Key

My.Computer.Registry.CurrentUser.CreateSubKey("MyTestKey")

Looks good doesn't it, I think the MY class looks outstanding, what are your views on the new MY cla:unsure:sure:

Kind Regards

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

i wouldent call them all tedious, using the clipboard for instance was relitivly simple: Clipboard.SetDataObject(myText)

supose its good they are grouped under the 1 heading as before they were all in seprate places.

Link to comment
Share on other sites

  • 0

Hmm....can you get what type of key a key in the registry is? (string, integer, array, etc) I went to write a program in vb.net2k3, and gave up because I couldn't find a way to do it.

Link to comment
Share on other sites

  • 0
Looks good doesn't it, I think the MY class looks outstanding, what are your views on the new MY class ?

Looks great but I'm a C# programmer :(. I'm sure someone will port it over.

Link to comment
Share on other sites

  • 0

Actually, it already is available.

To use "My" in C# (or any other language), import Microsoft.VisualBasic.dll (it's a standard .NET assembly). All of the "My" objects are in the Microsoft.VisualBasic.MyServices namespace. It doesn't work quite the same way as it does in VB, but I've tested a few of the classes and they appear to work just fine.

Link to comment
Share on other sites

  • 0

LOL! VB is getting simpler by the minute, i don't particularly like some of it though... i mean if everything was all done for you, then the learning experience at times go... :(

Link to comment
Share on other sites

  • 0
Actually, it already is available.

To use "My" in C# (or any other language), import Microsoft.VisualBasic.dll (it's a standard .NET assembly). All of the "My" objects are in the Microsoft.VisualBasic.MyServices namespace. It doesn't work quite the same way as it does in VB, but I've tested a few of the classes and they appear to work just fine.

Wow. I heard that it was something especially built for VB, but I was wondering how they were going to do that. :D

That's pretty cool. I probably won't use it, because I release a lot of my code and I don't want to look like a newbie. :p

Link to comment
Share on other sites

  • 0
That's pretty cool. I probably won't use it, because I release a lot of my code and I don't want to look like a newbie. :p

I won't use it, because I just don't need it. I use a C language because I want to use a C language. If I needed my hand held, I'd use VB already.

Link to comment
Share on other sites

  • 0
That's pretty cool. I probably won't use it, because I release a lot of my code and I don't want to look like a newbie. :p

heh, that's such a stupid reason. Code is meant to be easy to read, especially if you're releasing for others to use and adapt. Why do something the hard way just to look smarter?

Link to comment
Share on other sites

  • 0
heh, that's such a stupid reason. Code is meant to be easy to read, especially if you're releasing for others to use and adapt. Why do something the hard way just to look smarter?

Gotta agree with you there ! :happy:

Link to comment
Share on other sites

  • 0
heh, that's such a stupid reason. Code is meant to be easy to read, especially if you're releasing for others to use and adapt. Why do something the hard way just to look smarter?

*Sniff*. I have a self-esteem problem... :p

I don't know. I may use it. Oh the other hand it requires me to import another big DLL.

And I do 95% of my development on web applications, where most of these options will be useless.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.