Click to See Complete Forum and Search --> : Shell command
MetallicaD
Sep 18th, 2002, 11:43 AM
Hello all.. I am looking for the easist way to do a shell command.. basically, I want to do a Net Send.. i am converting a program from VB6 to .NET and would like to use the framework as much as possible. In the old program, i just issued the shell command and avoided the APIs.. do i need to use the APIs in .net or is something built in.. if not, can I shell it, and how do i do so..
thanks,
-mcd
Cander
Sep 18th, 2002, 12:23 PM
something like system.diagnostics.process("net blah")
probably not correct,but close.
MetallicaD
Sep 18th, 2002, 12:44 PM
Cander.. thanks for responding to my thread.. can always count on you for a response..
starting a process doesnt work in this situation.. i just used the same old thing from VB6 (Shell command) in the mean time until i can see if the framework has something better for me... here is my code:
Private Function SendMessage(ByVal v_To As String, ByVal v_Message As String) As Boolean
Try
Shell(String.Format("net send {0} {1}", v_To, v_Message))
SendMessage = True
Catch e As Exception
SendMessage = False
End Try
End Function
thanks for the suggestion!
-mcd
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.