Kernel

          Class 
          Member of  ScriptUtils Use Kernel object 

Description
COM API for calling some of Kernel32 functions.
Object model
Kernel - COM API for calling some of Kernel32 functions.
 
Process - Process object. Timing informations, priority settings and Ids. (CurrentProcess property, Current process.)
 
 
Thread - Thread object. Timing informations, priority settings and Ids. (PrimaryThread property, Primary thread of the process.)
 
Thread - Thread object. Timing informations, priority settings and Ids. (CurrentThread property, Current thread)
   
Process - Process object. Timing informations, priority settings and Ids. (Process property, The process of the thread.)
Methods
CloseHandle Closes an open object handle.
CopyFile The CopyFile method copies an existing file to a new file.
CreateProcess Creates a new process and its primary thread. The new process executes the specified executable file.
DeleteFile The DeleteFile method deletes an existing file.
MoveFile The MoveFile method renames/moves an existing file or a directory (including all its children).
Sleep Suspends the execution of the current thread for a specified interval.
SwitchToThread Causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the thread to yield to.
WaitForSingleObject returns when one of the following occurs:
The specified object is in the signaled state
. The time-out interval elapses.
Properties
CurrentDirectory Retrieves or sets the current directory for the current process.
String, RW
CommandLine The command-line string for the current process.
String, RO
ComputerName Retrieves the computer name of the current systιm.
String, RO
CurrentProcess Current process.
Process, RO
CurrentThread Current thread
Thread, RO
EnvironmentStrings The environment block for the current process.
String, RO
EnvironmentVariables Retrieves the value of the specified variable from the environment block of the calling process.
String, RO
hrCounter Retrieves the current value of the high-resolution performance counter, if one exists.
double, RO
hrFrequency Retrieves the frequency of the high-resolution performance counter, if one exists.
double, RO
hrTimeCounter Retrieves the current value of the high-resolution performance counter, if one exists. The value of counter is converted to time (divided by hrFrequency).
double, RO
TempPath Retrieves the path of the directory designated for temporary files.
String, RO
TickCount The number of milliseconds that have elapsed since Windows was started.
Long, RO
Examples
 Write system variables.  
<%
  Set Kernel = CreateObject("ScriptUtils.Kernel")'Creates the Kernel object
  Response.Write "<PRE>"
  Response.Write "<br>ComputerName       :" & Kernel.ComputerName
  Response.Write "<br>CommandLine        :" & Kernel.CommandLine
  Response.Write "<br>CurrentDirectory   :" & Kernel.CurrentDirectory
  Response.Write "<br>TempPath           :" & Kernel.TempPath 
  Response.Write "<br>EnvironmentStrings :" & Kernel.EnvironmentStrings 
  Response.Write "<br>Process.KernelTime :" & Kernel.CurrentProcess.KernelTime
  Response.Write "<br>Process.UserTime   :" & Kernel.CurrentProcess.UserTime
  Response.Write "<br>Thread.KernelTime  :" & Kernel.CurrentThread.KernelTime
  Response.Write "<br>Thread.UserTime    :" & Kernel.CurrentThread.UserTime
  Dim I
  For I=1 To 10
    Response.Write "<br>TickCount          :" & Kernel.TickCount
    Kernel.Sleep 500
  Next
  Response.Write "</PRE>"
%>
 Timing informations.  
<Script RunAt=Server Language=VBScript>
  Set Kernel = CreateObject("ScriptUtils.Kernel")'Creates the Kernel object
  'Get start times
  TickCount = Kernel.TickCount
  KernelTime = Kernel.CurrentThread.KernelTime
  UserTime = Kernel.CurrentThread.UserTime

  '…………………..
  'Some script commands
  '…………………………..
  For i=1 To 100000
    j = i
  Next

  'Write times
  Response.Write "<br>Script time : " & (Kernel.TickCount - TickCount) & " ms"
  Response.Write "<br>Kernel time : " & CLng((Kernel.CurrentThread.KernelTime - KernelTime)*86400000) & " ms"
  Response.Write "<br>UserTime time : " & CLng((Kernel.CurrentThread.UserTime - UserTime)*86400000) & " ms"
  Kernel = Empty
</Script>
  Other links for Kernel class
ScriptUtilities and Huge ASP file upload classes
      Easy to use, hi-performance ASP file upload component with progress bar indicator. Let's you upload multiple files with size up to 2GB to a disk or database along with another form fields. Works with large posts, any character set (including unicode utf-8). Contains one-click multiple files/folders download with on-the-fly compression (Using BinaryWrite/BinaryRead).
      Hi-performance text file logging for ASP/VBScript/VBA applications. Lets you create daily/weekly/monthly log files with variable number of logged values and extra timing and performance info.
       Lets you work with safearray binary data in VBS/JS. It also enables conversion between binary and String data using several code pages. ZLib compress and uncompress functions. Lets you transfer files using compressed stream from a client to server using IE.
      This library also enables calling of some Kernel and Advapi functions (performance, timing, sleep, configuration ...) and enables native work with INI files.


© 1996 – 2005 Motobit Software, help{at}pstruh.cz, help v. 2.16.14