Although I don't know about dephi and multithreading, I don't know much about dephi, but it is still quite easy to use and secure. record logs are saved in a specific format and the specified software can be opened and written down.
Interface Class
Code
// C # Call dephi
Public static class drawchartfromdll
{
// Function set_save_path (Adir: pchar): Cardinal; stdcall;
// Function log_message (acode: integer; abuffer: pointer; abuffersize: DWORD): Cardinal; stdcall;
// Function log_error (acode: integer; abuffer: pointer; abuffersize: DWORD): Cardinal; stdcall;
// Function save: Cardinal; stdcall;
// Function set_active (avalue: longbool): Cardinal; stdcall;
// Call an unmanaged DLL. getchartfromxmlbynet is the name of the function exposed by chartaccess. dll.
[Dllimport ("log. dll", entrypoint = "set_save_path", charset = charset. ANSI, callingconvention = callingconvention. stdcall)]
// Set the Save path (D :\)
Public static extern void set_save_path (string path );
[Dllimport ("log. dll", entrypoint = "log_message", charset = charset. ANSI, callingconvention = callingconvention. stdcall)]
// Log information
Public static extern int log_message (INT code, intptr abuffer, int abuffersize );
[Dllimport ("log. dll", entrypoint = "log_error", charset = charset. ANSI, callingconvention = callingconvention. stdcall)]
// Log error message
Public static extern int log_error (INT code, intptr abuffer, int abuffersize );
[Dllimport ("log. dll", entrypoint = "save", charset = charset. ANSI, callingconvention = callingconvention. stdcall)]
// Save Method
Public static extern int save ();
[Dllimport ("log. dll", entrypoint = "set_active", charset = charset. ANSI, callingconvention = callingconvention. stdcall)]
// Whether to enable the log function
Public static extern int set_active (bool value );
ASP. NET implementation:
Code
Public class loginput
{
Public loginput ()
{
//
// Todo: add the constructor logic here
//
}
/// <Summary>
/// Set the Save path (D :\)
/// </Summary>
/// <Param name = "path"> </param>
Public static void set_save_path (string path ){
Drawchartfromdll. set_save_path (PATH );
}
/// <Summary>
/// Log information
/// </Summary>
/// <Param name = "code"> </param>
/// <Param name = "message"> </param>
Public static void log_message (INT code, string message)
{
Drawchartfromdll. log_message (Code, Marshal. stringtohglobalansi (Message), system. Text. encoding. Default. getbytecount (Message ));
}
/// <Summary>
/// Log error message
/// </Summary>
/// <Param name = "code"> </param>
/// <Param name = "message"> </param>
Public static void log_error (INT code, string message)
{
Drawchartfromdll. log_message (Code, Marshal. stringtohglobalansi (Message), system. Text. encoding. Default. getbytecount (Message ));
}
/// <Summary>
/// Save Method
/// </Summary>
Public static void save (){
Drawchartfromdll. Save ();
}
/// <Summary>
/// Whether to enable the log function
/// </Summary>
/// <Param name = "value"> </param>
Public static void set_active (bool value ){
Drawchartfromdll. set_active (value );
}
}
Call:
Code
PDL. Common. loginput. set_active (true );
PDL. Common. loginput. set_save_path (server. mappath ("\\"));
PDL. Common. loginput. log_message (0, "log function started ");
Response. Write ("START success ");
PDL. Common. loginput. log_message (0, "log function disabled ");
PDL. Common. loginput. Save ();
PDL. Common. loginput. set_active (false );
Response. Write ("Shut success ");