i added file extesions to associate with my program from Puplish/Option/File Association

But i dont know how to execute related codes when users open the file associated with my program?

how can it perform a specific code associate file type and determine which file type it is after program loaded?

You need to retrieve the command-line arguments, if any, and test the first argument. It should be the file that launched the application.

        Dim fi As IO.FileInfo ' used to test for file properties
        If My.Application.CommandLineArgs.Count > 0 Then
            fi = New IO.FileInfo(My.Application.CommandLineArgs(0))
            If fi.Exists Then
                Select Case fi.Extension.ToLower
                    Case ".fred"
                        ' do something with fred
                    Case ".wilma"
                        ' do something with wilma
                    Case Else
                        ' do something else
                End Select
            End If
        End If

You are welcome.

Please close this thread out if your problem is solved.