VB.NET Choose Box Boite Dialogue Oui/Non

Ouvrir une boite de dialog et exécuter une action en fonction du choix

If MessageBox.Show("Voulez vous?", "Erreur!", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
 Debug.Print("Yes!")
Else
Debug.Print("No!")
End If

VB.NET Acces a une base de donnees Access MDB

Les imports

Imports System
Imports System.Data
Imports System.Data.OleDb

Le code:

Dim mCnx As OleDb.OleDbConnection = Nothing
mCnx = New OleDbConnection
mCnx.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=c:/mydb.mdb"
mCnx.Open()
Dim maCommand As New OleDbCommand("SELECT * FROM table1", mCnx)
Dim monReader As OleDbDataReader = maCommand.ExecuteReader()
While monReader.Read
debug.print monReader("ROW")
End While
monReader.Close()
mCnx.Close()

VB.NET Tuer un processus

Dim plist As Process() = Process.GetProcesses()
For Each p As Process In plist
Try
If p.MainModule.ModuleName.ToUpper() = "FIREFOX.EXE" Then p.Kill()
Catch
End Try
Next p