473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

net send without using net send?

hello,

i am searching for a while to use net send in vb.net without using the
commandline net send... is there an api, with an example... i know
that there is the possib. to send such messages over the lan with
another sender name - how can i do this ... is it possible in vb.net?

thanks
Nov 21 '05 #1
6 3834
"Thomas" <ei*@gmx.net> schrieb:
i am searching for a while to use net send in vb.net without using the
commandline net send... is there an api, with an example... i know
that there is the possib. to send such messages over the lan with
another sender name


P/invoke on 'NetMessageBufferSend':

<URL:http://groups.google.de/groups?selm=%23zdzRqrTDHA.2316%40tk2msftngp13.phx. gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
thanks, it looks really good,but it doesn´t send any message... my
code is now(taken from your hint):

Public Class Form1
Dim ret As String
Private Declare Unicode Function NetMessageBufferSend Lib
"netapi32.dll" ( _
ByVal servername As String, _
ByVal msgname As String, _
ByVal fromname As String, _
ByVal msgbuf As String, _
ByVal msgbuflen As Int32 _
) As Int32

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strmessage As String = "testmessage..."
ret = NetMessageBufferSend("*", "testmsgname", "fromname",
strmessage, strmessage.Length * 2 + 2)
MsgBox(ret)
End Sub
End Class

On Sat, 22 Jan 2005 13:05:18 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Thomas" <ei*@gmx.net> schrieb:
i am searching for a while to use net send in vb.net without using the
commandline net send... is there an api, with an example... i know
that there is the possib. to send such messages over the lan with
another sender name


P/invoke on 'NetMessageBufferSend':

<URL:http://groups.google.de/groups?selm=%23zdzRqrTDHA.2316%40tk2msftngp13.phx. gbl>


Nov 21 '05 #3
"Thomas" <ei*@gmx.net> schrieb:
thanks, it looks really good,but it doesn´t send any message... my
code is now(taken from your hint):
[...]
ret = NetMessageBufferSend("*",


The first parameter expects a server name. MSDN:

---
Pointer to a constant string that specifies the DNS or NetBIOS name of the
remote server on which the function is to execute. If this parameter is
'NULL', the local computer is used.
Windows NT: This string must begin with "\\".
---

If you want to use the local computer, pass 'vbNullString' to the first
parameter. Otherwise construct the server name as described above.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4
i´m sorry, but i´ve done the changes, it doesn´t really work... - the
return code is 2273 ...do you know the return codes?

Public Class Form1
Dim ret As String
Private Declare Unicode Function NetMessageBufferSend Lib
"netapi32.dll" ( _
ByVal servername As String, _
ByVal msgname As String, _
ByVal fromname As String, _
ByVal msgbuf As String, _
ByVal msgbuflen As Int32 _
) As Int32

Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim strmessage As String = "testmessage..."
Const servername As String = vbNullString
ret = NetMessageBufferSend(servername, "testmsgname",
"fromname", strmessage, strmessage.Length * 2 + 2)
MsgBox(ret)
End Sub
End Class

On Sat, 22 Jan 2005 14:21:19 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Thomas" <ei*@gmx.net> schrieb:
thanks, it looks really good,but it doesn´t send any message... my
code is now(taken from your hint):
[...]
ret = NetMessageBufferSend("*",


The first parameter expects a server name. MSDN:

---
Pointer to a constant string that specifies the DNS or NetBIOS name of the
remote server on which the function is to execute. If this parameter is
'NULL', the local computer is used.
Windows NT: This string must begin with "\\".
---

If you want to use the local computer, pass 'vbNullString' to the first
parameter. Otherwise construct the server name as described above.


Nov 21 '05 #5
"Thomas" <ei*@gmx.net> schrieb:
i´m sorry, but i´ve done the changes, it doesn´t really work... - the
return code is 2273 ...do you know the return codes?


That's 'NNERR_NameNotFound' ("The user name could not be found").

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
thanks a lot, i´ve found the problem

msgbuf has to be the message... i was a little bit lazy in reading:-)

On Sat, 22 Jan 2005 15:58:15 +0100, "Herfried K. Wagner [MVP]"
<hi***************@gmx.at> wrote:
"Thomas" <ei*@gmx.net> schrieb:
i´m sorry, but i´ve done the changes, it doesn´t really work... - the
return code is 2273 ...do you know the return codes?


That's 'NNERR_NameNotFound' ("The user name could not be found").


Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
2
by: Walter CF | last post by:
Hi, I develop an application that send mail using system.web.mail namespace, It work without problems over Windows Xp, but in windows 98 it dont't work, I've read from...
6
by: AbraAbraCadabra | last post by:
Here is the code I have been using to send mail... Set objCDO = Server.CreateObject("CDO.Message") With objCDO .To = strTo .From = "markus@domain.com" .Subject = "This is the...
0
by: Atenza | last post by:
Hi all, I develop an VB6 program to send email by using CDOSYS.DLL. It works fine as follow: Dim iMsg As New CDO.Message Dim iDsrc As CDO.IDataSource Set iDsrc = iMsg ' (QueryInterface)...
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
5
by: Sin Jeong-hun | last post by:
Hi. I would like to let users send bug reports or other messages to me. Maybe the easiest way to send e-mails from my application is just use the default e-mail agent by executing a link...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
1
by: mike11d11 | last post by:
I am using this code to create an email to send automaticaly in my program, the only problem is I get the security warning and I just want the email to go out on its own without the warning. I...
1
by: Tbone | last post by:
Is there any way to send a Message without having the .NET framework add the "serialization" data to the body of the message? I am sending binary structures in the message and I need full control...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.