473,508 Members | 3,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send network messages

Hi,

i'm searching a way how to send a message through
the messenger service. i found the corresponding
function in the "netapi32.dll". Now i got problems
while i try to use it.

Can anybody help me and say me how to do it or another
way to realize this feature?

Thx
Jan
(ps: i'm using vb .net 2002)
Nov 20 '05 #1
8 11004
The API is NetMessasgeBufferSender, and should be declared like this:

(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (ByVal
strServer As String, ByVal strTitle As String, ByVal strFrom As String,
ByVal strBuf As String, ByVal intLength As Integer) As Integer

</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend("Server", "SendToComputer", "SentFromComputer", strMsg,
strMsg.Length)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Jan B." <no****@me.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

i'm searching a way how to send a message through
the messenger service. i found the corresponding
function in the "netapi32.dll". Now i got problems
while i try to use it.

Can anybody help me and say me how to do it or another
way to realize this feature?

Thx
Jan
(ps: i'm using vb .net 2002)

Nov 20 '05 #2
Hi,

i tried it like you said but all thats coming back is
errostatus 123. is it the format used? Do i have to use
"\\" in front of the names?

Thx
Jan
-----Original Message-----
The API is NetMessasgeBufferSender, and should be declared like this:
(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (ByValstrServer As String, ByVal strTitle As String, ByVal strFrom As String,ByVal strBuf As String, ByVal intLength As Integer) As Integer
</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend ("Server", "SendToComputer", "SentFromComputer", strMsg,strMsg.Length)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Jan B." <no****@me.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

i'm searching a way how to send a message through
the messenger service. i found the corresponding
function in the "netapi32.dll". Now i got problems
while i try to use it.

Can anybody help me and say me how to do it or another
way to realize this feature?

Thx
Jan
(ps: i'm using vb .net 2002)

.

Nov 20 '05 #3
Error 123 is ERROR_INVALID_NAME, so yes, it may be because the \\ are
required, or you have accidentally misspelt a computer name.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Jan B." <no****@me.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

i tried it like you said but all thats coming back is
errostatus 123. is it the format used? Do i have to use
"\\" in front of the names?

Thx
Jan
-----Original Message-----
The API is NetMessasgeBufferSender, and should be declared like this:
(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend Lib "NETAPI32.DLL" (ByValstrServer As String, ByVal strTitle As String, ByVal strFrom As String,ByVal strBuf As String, ByVal intLength As Integer) As Integer
</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend ("Server", "SendToComputer", "SentFromComputer", strMsg,strMsg.Length)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Jan B." <no****@me.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

i'm searching a way how to send a message through
the messenger service. i found the corresponding
function in the "netapi32.dll". Now i got problems
while i try to use it.

Can anybody help me and say me how to do it or another
way to realize this feature?

Thx
Jan
(ps: i'm using vb .net 2002)

.

Nov 20 '05 #4
Hi,

i tried nearly all types of names and used all possible
configurations. So i think theres another problem than
only the wrong name. i can use the name when i try it with
net send ... So i don't know.....

Ciao, Thx
Jan
-----Original Message-----
Error 123 is ERROR_INVALID_NAME, so yes, it may be because the \\ arerequired, or you have accidentally misspelt a computer name.
--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Jan B." <no****@me.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

i tried it like you said but all thats coming back is
errostatus 123. is it the format used? Do i have to use
"\\" in front of the names?

Thx
Jan
-----Original Message-----
The API is NetMessasgeBufferSender, and should be

declared like this:

(Replace <Scope> with Public/Private/Friend)

<WatchForWrapping>

<Scope> Declare Function NetMessageBufferSend

Lib "NETAPI32.DLL" (ByVal
strServer As String, ByVal strTitle As String, ByVal

strFrom As String,
ByVal strBuf As String, ByVal intLength As Integer) As

Integer

</WatchForWrapping>

Then can be called like this:

Dim strMsg As String = "This is a network message"
NetMessageBufferSend

("Server", "SendToComputer", "SentFromComputer", strMsg,
strMsg.Length)

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit
"Jan B." <no****@me.com> wrote in message
news:0a****************************@phx.gbl...
Hi,

i'm searching a way how to send a message through
the messenger service. i found the corresponding
function in the "netapi32.dll". Now i got problems
while i try to use it.

Can anybody help me and say me how to do it or another
way to realize this feature?

Thx
Jan
(ps: i'm using vb .net 2002)

.

.

Nov 20 '05 #5
Hi ,

thanks for your tip. Right now i use the shell command like
you told me. but since the program might run on machines
where the net command has been removed i wanted to use
some other method.
Your mailslot info is quite interesting but i need to
address the users instead of the machine.

Thx
Jan
-----Original Message-----
Hi Jan,

You don't need to call any function in "netapi32.dll" if you only need tosend a message through the messenger service. The simplest way is to callShell in VB. You can use the following code to do this.

Shell("net send <destination computer> hello")

You could also use mailslot to programmatically send message. Just send themessage to "\\.\mailslot\messngr"

The following link may help:

http://groups.google.com/groups?q=%5Cmailslot% 5Cmessngr&hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&selm=6b7slb%2427h%241%40tor- nn1.netcom.ca&rnum=6
If there's anything unclear, please feel free to reply to the post.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers norights."

.

Nov 20 '05 #6
Cor
That is no topic for this newsgroup, to run a VB.net language application
you need to have installed the net framework on the computer running it.
Nov 20 '05 #7
@first: Hello,

for sure i got the framwork installed. i don't understand
why youre saying this is the wrong newsgroup since
i asked how to send a network message for the messenger
service out of a vb .net app.

feel free to explain yourself.

Jan

-----Original Message-----
That is no topic for this newsgroup, to run a VB.net language applicationyou need to have installed the net framework on the computer running it.

.

Nov 20 '05 #8
No Problem ;-)
-----Original Message-----
Jan,
Maybe I did understand this wrong

thanks for your tip. Right now i use the shell command likeyou told me. but since the program might run on machines
where the net command has been removed i wanted to use
some other method.
Your mailslot info is quite interesting but i need to
address the users instead of the machine.

I thought that you did mean the .Net framework

Cor
.

Nov 20 '05 #9

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

Similar topics

6
4617
by: Ray Paseur | last post by:
We broadcast email messages with PHP scripts, but sometimes email is not timely and we would like to send something that could get there faster. Can anyone tell me about how to send Instant...
4
4316
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
3
9242
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception ā€œCould not access 'CDO.Message' objectā€ when I call SmtpMail.Send. This only happens when I send...
3
2331
by: Jon | last post by:
Hi, in my program, i want to send a signal to other computer on the network (LAN). so that when other recieves this signal, it will do something... What Class should I use for sending the...
1
2907
by: yoshitha | last post by:
Hi i've to send SMS message to a mobile phone from Pc (using asp.net application) i dont know which namespaces to include and what requirements i need in order to full fill this requirement ...
1
2715
by: CKane | last post by:
i am trying to build a "missed message" queue on a C# TCP server. many of the devices connecting are mobile and may drop out in bad signal areas. i want to store any messages missed for when they...
14
11861
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...
15
8371
by: dennis.richardson | last post by:
Greetings all. Here's a problem that's been driving me nuts for the last 48 hours. I'm hoping that someone has come across this before. I have a C# Application that reads a UDP broadcast...
0
2128
by: ernieblackhawk | last post by:
hi guys, i wanna ask about how to make a VB based program to send messages to a local network, it usually work with command "net send <user><msg>", or sumthing like that. n i have a simple code...
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7333
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
7398
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...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4716
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.