|
-
Feb 20th, 2005, 07:29 AM
#1
Thread Starter
Junior Member
net send problem
I made a little program that is using the net send command.I want it to display a mesage if it failed to send the message,or whatever error the dos returned.I got a tip to use a txt file (like in command.com when u write after everything >> c:\this.txt),but it doesn't work.Any ideas how can do this?
Thanx!
-
Feb 20th, 2005, 03:24 PM
#2
Re: net send problem
Here is one way.
Note: You could remove the Else section, and place the error code after a False condition. (So you just have an If..Then)
VB Code:
Dim intFF As Integer
'Handle sent message action
If NetMessageBufferSend(ByVal 0&, bytToName(0), ByVal 0&, bytMsg(0), UBound(bytMsg)) = 0 Then
'Message succeeded
Else
'Message failed
MsgBox Environ$("USERNAME") & ", there was an error sending your message." & vbCrLf & _
"Please try again.", vbCritical + vbOKOnly, App.Title & " - Send Error"
intFF = FreeFile
Open "C:\NetSend_Log.txt" For Append As #intFF
Print #intFF, Now 'Capture the date and time the failure occured
Close #intFF
End If
Bruce.
Last edited by Bruce Fox; Feb 20th, 2005 at 03:53 PM.
-
Feb 20th, 2005, 04:31 PM
#3
Fanatic Member
Re: net send problem
Or if you want to use API you can look at this example, created by ME
http://pscode.com/vb/scripts/ShowCod...51063&lngWId=1
p.s. it has error reporting
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|