Large Posted July 27, 2004 Share Posted July 27, 2004 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 More sharing options...
0 spike232 Posted July 27, 2004 Share Posted July 27, 2004 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 More sharing options...
0 Mengcct Posted July 27, 2004 Share Posted July 27, 2004 :laugh: where have more codes similar as those codes? thx a lot i cant remember those variables names easily... Link to comment Share on other sites More sharing options...
0 Large Posted July 27, 2004 Author Share Posted July 27, 2004 The MY printer commands will definately make things easier when printing ! :yes: Link to comment Share on other sites More sharing options...
0 Mordkanin Posted July 27, 2004 Share Posted July 27, 2004 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 More sharing options...
0 Sn1p3t Posted July 27, 2004 Share Posted July 27, 2004 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 More sharing options...
0 Large Posted July 27, 2004 Author Share Posted July 27, 2004 The MY class is part of the .net framework 2.0 so it will be available in all .net languages, so that would include C#. Link to comment Share on other sites More sharing options...
0 smurfiness Posted July 27, 2004 Share Posted July 27, 2004 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 More sharing options...
0 Winston Posted July 27, 2004 Share Posted July 27, 2004 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 More sharing options...
0 Sn1p3t Posted July 28, 2004 Share Posted July 28, 2004 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 More sharing options...
0 Matt Posted July 28, 2004 Share Posted July 28, 2004 sounds interesting. soon im beginning to learn vb net. Link to comment Share on other sites More sharing options...
0 smurfiness Posted July 28, 2004 Share Posted July 28, 2004 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 More sharing options...
0 karmakillernz Posted July 28, 2004 Share Posted July 28, 2004 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 More sharing options...
0 Large Posted July 28, 2004 Author Share Posted July 28, 2004 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 More sharing options...
0 Sn1p3t Posted July 28, 2004 Share Posted July 28, 2004 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 More sharing options...
Question
Large
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
Read and write to the clipboard
Create a Directory
Move a Directory
Check a Connection
Create a Registry Key
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