Search This Blog

Tuesday, February 9, 2010

Executing a Command or BAT file in VB.net
















Use
shell("command")
or
process.start()

Dim ps As System.Diagnostics.Process

'to start
ps = System.Diagnostics.Process.Start("IEXPLORE.EXE")

'to stop
ps.Kill()






 

Wednesday, February 3, 2010

Excute Button Click event Code

Execute buttons clicl event code from other code...

PerformClick() proerty of button is used to execute the whole code, which executes on click. Its like virtual click.

Button_1.performClick()

Using DLL in VB.NET

How to use DLL in VB.NET?
Answer:  DllImport

example code:

Public class use_dll
   'FUNCTION
    _
        Public Function fun_1(ByVal Str As String, _
        byVal ingr as integer) As integer
    End Function


'SUB
                                       _
                                          Public SUB fun_2(ByVal Str As String, _
        byVal ingr as integer) 

    End Sub

'event on some button click
fun_2()
messagebox.show(fun_1().tostring)
end class