Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sending a msg to NT Administrators
Message
De
08/01/2000 09:55:48
 
 
À
08/01/2000 08:31:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00314911
Message ID:
00314921
Vues:
22
>Is is at all possible to send a message to the NT administrators from within VFP 5.0?
>
>Actually, I'd like to inform the administrator that an error had occurred in the application. Are there other ways of doing that besides sending a message to the admins?
>

What exactly do you want to do for notification? If you're running on an NT system, you could log errors to the NT Event log using the WSH 2.0 Wscript.Shell automation object fairly easily, there's a LogEvent method available:

oShell = CREATEOBJ('Wscript.Shell')
oShell.LogEvent(nIntType,cLogMessage,cTargetMachine)

nIntType may be one of:
Number  Event Type
     0     Success
     1     Error
     2     Warning
     4     Information
     8     Audit_Success
    16     Audit_Failure
cLogMessage can be a string of up to 255 bytes

You can specify a different machine's NetBIOS name as the third parameter. If omitted under NT, the current system's Event Log is used. Win9x writes to a local log in the System directory called WSH.LOG, and will ignore the third parameter in all cases.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform