Module 权限
Public Function 是否为管理员()
Dim identity As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim principal As WindowsPrincipal = New WindowsPrincipal(identity)
Return principal.IsInRole(WindowsBuiltInRole.Administrator)
End Function
End Module
Private Sub TextBoxDec_KeyPress(sender As Object, e As KeyPressEventArgs)
If e.KeyChar <> "8" And Not Char.IsDigit(e.KeyChar) And e.KeyChar <> "." Then
e.Handled = True
End If
End Sub
Private Sub DataGridView1_EditingControlShowing(sender As Object, e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
Dim columnIndex As Integer = 4
If DataGridView1.CurrentCell.ColumnIndex = columnIndex Then
AddHandler e.Control.KeyPress, AddressOf TextBoxDec_KeyPress
Else
RemoveHandler e.Control.KeyPress, AddressOf TextBoxDec_KeyPress
End If
Me.Text = DataGridView1.CurrentCell.ColumnIndex.ToString
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
End Sub
获取当前程序路径及程序名
Application.ExecutablePath
获取程序启动参数(注:参数前后有双引号)
dim para as String=Microsoft.VisualBasic.Command