Visual Basic Development Bookmark and Share   
 Home > Visual Basic Power Packs > open
 

open

i have problem. how to open object such as game on desktop. i don't now what coding suppose to use. i use vb.net
mkc90  Saturday, November 14, 2009 1:08 PM
I still didnt get what you mean by open folder. You want to do some processing on folder contents ? Like get Files, directories from particular directory ?

For that you could use the following:

        Dim di As IO.DirectoryInfo

        'Check if Directory exists, DirectoryNotFound exception will be unhandled otherwise,
        'in case directory doesnt exist
        If IO.Directory.Exists("C:\Folder") Then
            di = New IO.DirectoryInfo("C:\Folder")
        End If

        'Following code should be inside same If block to avoid possible Null Reference Exception

        'Get directories into an Array
        Dim directories() As IO.DirectoryInfo = di.GetDirectories()

        'Get files into an Array
        Dim files() As IO.FileInfo = di.GetFiles()

        'Filtered Files
        Dim textFiles() As IO.FileInfo = di.GetFiles("*.txt")

        'Iterate through directories
        For Each Dir As IO.DirectoryInfo In di.GetDirectories
            'Do something
            MsgBox(Dir.FullName)
        Next

Thanks

â™?My Blog â™?My Facebook â™?YOUR Place to have fun time ! â™?Awesome RPG Action Game
Omie  Saturday, November 14, 2009 2:21 PM

as in on Button Click you want to open a game ?

Process.Start("CompletePathToGame.exe")

If you you dont want this,

you need to explain more.





Thanks

â™?My Blog â™?My Facebook â™?YOUR Place to have fun time ! â™?Awesome RPG Action Game
Omie  Saturday, November 14, 2009 1:30 PM
Dim di As New System.IO.DirectoryInfo("C:\new folder")

di.Delete(True)

i use this coding to delete folder. but how to open folder and the contain?
mkc90  Saturday, November 14, 2009 1:54 PM
I still didnt get what you mean by open folder. You want to do some processing on folder contents ? Like get Files, directories from particular directory ?

For that you could use the following:

        Dim di As IO.DirectoryInfo

        'Check if Directory exists, DirectoryNotFound exception will be unhandled otherwise,
        'in case directory doesnt exist
        If IO.Directory.Exists("C:\Folder") Then
            di = New IO.DirectoryInfo("C:\Folder")
        End If

        'Following code should be inside same If block to avoid possible Null Reference Exception

        'Get directories into an Array
        Dim directories() As IO.DirectoryInfo = di.GetDirectories()

        'Get files into an Array
        Dim files() As IO.FileInfo = di.GetFiles()

        'Filtered Files
        Dim textFiles() As IO.FileInfo = di.GetFiles("*.txt")

        'Iterate through directories
        For Each Dir As IO.DirectoryInfo In di.GetDirectories
            'Do something
            MsgBox(Dir.FullName)
        Next

Thanks

â™?My Blog â™?My Facebook â™?YOUR Place to have fun time ! â™?Awesome RPG Action Game
Omie  Saturday, November 14, 2009 2:21 PM

You can use google to search for other answers

Custom Search

More Threads

• When i draw Rubberband selection on panel VisualBasic powerpack Shapecontrols are not displayed
• Having problems with DataRepeater control and virtual mode
• Power Pack 2 application install problem
• Is VB.NET applicaiton using Powerpacks 2.0 convertable to C# .NET
• change the BackColor of the CurrentItem of the dataRepeater on MouseHover event.
• WebBrowser Control in visual basic 2005
• DataRepeater - Binding + Format event
• Printing reports
• Printer compatability library source code ?
• Graphic line will not print