Surendran's profile..::SUreN::..PhotosBlogListsMore ![]() | Help |
..::SUreN::..life is going on, but where??? |
||||||||||
|
9/4/2008 Session Variables< sessionStatemode ="InProc"stateConnectionString ="tcpip=127.0.0.1:42424"sqlConnectionString ="data source=127.0.0.1;Trusted_Connection=yes"cookieless ="false"timeout ="20"/> 4/22/2008 Two Background Images In Single Cellhtml:
CSS:
More than 100 Keyboard ShortcutsKeyboard Shorcuts (Microsoft Windows)
Microsoft Natural Keyboard Shortcuts
Shortcut Keys for Character MapAfter you double-click a character on the grid of characters, you can move through the grid by using the keyboard shortcuts:
Microsoft Management Console (MMC) Main Window Keyboard Shortcuts
MMC Console Window Keyboard Shortcuts
Remote Desktop Connection Navigation
Microsoft Internet Explorer Navigation
4/9/2008 5 cool things you can do with windows and phpMany PHP examples out there are designed for a linux/unix operating system. I am going to give some examples of some interesting functionality that only works with php running in a windows environment (IIS or apache). 1) Eject the CD-ROM //create an instance of Windows Media Player $mp = new COM("WMPlayer.OCX"); //ejects the first cd-rom on the drive list $mp->cdromcollection->item(0)->eject(); 2) Read and write from/to the registry function registry_read($folder, $key) { $WshShell = new COM("WScript.Shell"); $registry = “HKEY_LOCAL_MACHINE\SOFTWARE\\” . $folder . “\\” . $key; $result = $WshShell->RegRead($registry); return($result); } $key = registry_read(”RegisteredApplications”,”Firefox”); parameters: * Folder name - (key path past HKEY_LOCAL_MACHINE\SOFTWARE\\) * key - the key name to read from function registry_write($folder, $key, $value,$type="REG_SZ") { $WshShell = new COM("WScript.Shell"); $registry = “HKEY_LOCAL_MACHINE\SOFTWARE\\” . $folder . “\\” . $key; $result = $WshShell->RegRead($registry); $result = $WshShell->RegWrite($registry,$value, $type); return($result); } parameters: * Folder name - (key path past HKEY_LOCAL_MACHINE\SOFTWARE\\) * key - the key name to write to * value - value that will be written to the key * type - key type (default: REG_SZ) 3) register and un-register phpscripts as a windows service # registering a service win32_create_service(array( ’service’ => ‘myservice’, # the name of your service ‘display’ => ’sample dummy PHP service’, # description ‘params’ => ‘c:\path\to\script.php run’, # path to the script and parameters )); # un-registering a service win32_delete_service(’myservice’); # code run as a service if ($argv[1] == 'run') { win32_start_service_ctrl_dispatcher('myservice'); while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) { # write script here # as a general rule, keep it below 30 seconds through each loop iteration } } This uses the windows API Service DLL, which is not enabled by default. Here is how to install it: * Download the main library (it’s included in the main PECL extension download from php.net) here * extract php_win32service.dll to your ext directory (where your php extension .dlls are located) * add the following line to your php.ini: extension=php_win32service.dll 4) print pages/data #this is an example function that will format a host/printer name, for printing to shared printers over the network function getPrinter($host,$SharedPrinterName) { return “\\\\”.$host.”\\”.$SharedPrinterName; } #this opens the printer $handle = printer_open(getPrinter(”my computer 2″,”my printer”)); An extensive list of functions for printing can be found here #this is possible in *nix as well. Here is some example code function lpr($string,$printer) { $prn=(isset($printer) && strlen($printer))?”$printer”:C_DEFAULTPRN ; $CMDLINE=”lpr -P $printer “; $pipe=popen(”$CMDLINE” , ‘w’ ); if (!$pipe) {print “pipe failed.”; return “”; } fputs($pipe,$string); pclose($pipe); } This uses the windows API Service DLL, which is not enabled by default. Here is how to install it: * Download the main library (it’s included in the main PECL extension download from php.net) here * extract php_printer.dll to your ext directory (where your php extension .dlls are located) * add the following line to your php.ini: extension=php_printer.dll 5) List the current system processes # list all the current processes running on the system print_r(win32_ps_list_procs()); other related commands: # Retrieves statistics about the global memory utilization print_r(win32_ps_stat_mem()); # Retrieves statistics about the process with the process id pid (if no process id is given, the current process will be used) print_r(win32_ps_stat_proc(int processid)); This uses the windows API Service DLL, which is not enabled by default. Here is how to install it: * Download the main library (it’s included in the main PECL extension download from php.net) here * extract php_win32ps.dll to your ext directory (where your php extension .dlls are located) * add the following line to your php.ini: extension=php_win32ps.dll |
|
||||||||
|
|