mike mcintyre's

.N e t J o u r n a l

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

SepOctober 2008Nov
SMTWTFS
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Archives

Topics

Source Code

Sunday, October 19, 2008 #

Example:

  ' Create a LINQ query.

        Dim buttonQuery = From control In Me.Controls Where TypeOf (control) Is Button

        ' Create a list of object.

        Dim buttonList = buttonQuery.ToList

        ' Iterate through the objects in buttonList.

        For Each btn As Button In buttonList

            ' Show each button's text property.

            MessageBox.Show(btn.Text)

        Next

posted @ 1:50 PM

My makes it easy to use .Net. Here's an example that uses My to rename a file:

Syntax:

Public Shared Sub RenameFile ( _
    file As String, _
    newName As String _
)
file is the file path to the file to be renamed.

newName is the new name (with file extentsion) to be given to the file.

Example:

My.Computer.FileSystem.RenameFile("C:\OldName.txt", "NewName.txt")

 

Mike McIntyre
Get Dot Net Code
posted @ 1:38 PM