Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Try 'on gère les erreurs
- If My.Computer.Registry.ClassesRoot.OpenSubKey(".test1") Is Nothing Then
- 'si l'extension n'est pas encore associée, on l'associe.
- associerExtension()
- End If
- Catch ex As Exception
- MsgBox("Oups, erreur") 'message très descriptif..
- End Try
- 'on obtient les arguments, à savoir le nom du fichier avec lequel le prog s'est ouvert
- For Each argument As String In Environment.GetCommandLineArgs()
- If argument.Contains("test1") Then 'si il contient notre extension
- TextBox1.Text = TextBox1.Text & argument 'on affiche le chemin du fichier test1
- LireXML(argument)
- End If
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement