LostProgrammer Posted July 1, 2003 Posted July 1, 2003 Is it possible to call a dos command in vb .net? Thanks LP Quote
*Experts* Volte Posted July 1, 2003 *Experts* Posted July 1, 2003 Which command? There's probably a Windows equivilant. Quote
LostProgrammer Posted July 1, 2003 Author Posted July 1, 2003 I want to setup a intranet messenging program. Using the command Net send #machinename# #message# Thanks LP Quote
Administrators PlausiblyDamp Posted July 1, 2003 Administrators Posted July 1, 2003 Process.Start should do the trick. look for it in MSDN or search the archives, plenty examples Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Gurus* divil Posted July 1, 2003 *Gurus* Posted July 1, 2003 net send is not a DOS command. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Dark Kai Posted September 10, 2003 Posted September 10, 2003 I got this from MSDN. Hope it helps Dim p As New System.Diagnostics.Process() p.Start("C:\WINNT\system32\net.exe", "send <IPADDRESS> <Message>") Quote
Runtime_error Posted September 10, 2003 Posted September 10, 2003 I got this from MSDN. Hope it helps Dim p As New System.Diagnostics.Process() p.Start("C:\WINNT\system32\net.exe", "send <IPADDRESS> <Message>") So will that work on Windows NT from a remote webserver or will it only work locally. So what i mean is that if this a user goes to a page and then this code is executed then that will only work on the webserver rite? Quote
aewarnick Posted September 10, 2003 Posted September 10, 2003 As long as the web server has the dot net framework installed, I suppose. Quote C#
*Experts* Volte Posted September 10, 2003 *Experts* Posted September 10, 2003 Here's a basic class to send using the API:Imports System.Runtime.InteropServices Public Class NetSend 'Note the use of the Unicode keyword: Declare Unicode Function NetMessageBufferSend Lib "NETAPI32.dll" ( _ ByVal servername As String, _ ByVal msgname As String, _ ByVal fromname As String, _ ByVal buf As String, _ ByVal buflen As Int32) As Int32 Public Shared Sub Send(ByVal destination As String, ByVal message As String) NetMessageBufferSend(Nothing, _ destination, _ Nothing, _ message, _ message.Length * 2) 'times 2 because every one character = 2 bytes in unicode End Sub End ClassJust stick that in a class file and call it likeNetSend.Send("127.0.0.1", "this is a message") Quote
decrypt Posted January 2, 2004 Posted January 2, 2004 (edited) Is there anyway to get the Dim p As New System.Diagnostics.Process() p.Start("C:\WINNT\system32\net.exe", "send <IPADDRESS> <Message>") to not close right away? For example you push a key and it closes? Edited January 3, 2004 by decrypt Quote
Ontani Posted March 24, 2004 Posted March 24, 2004 y won't you just use the shell command? just declare 2 variables 1 for name/ip and 1 for message button1_click... Dim adress As String = textbox1.text Dim text As String = textbox2.text shell("net send " + adress + " " + text) normally it works. Greetz :) Quote www.purevision.be :: www.devpoint.be
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.