1.修改apache\conf\extra\httpd-xampp.conf:

    <Directory "C:/xampp/phpMyAdmin">
        AllowOverride AuthConfig
        #Require local
        Order allow,deny
        Allow from all
        Require all granted
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    </Directory>

2.在phpmyadmin给root用户设置密码
3.修改phpMyAdmin\config.inc.php

$cfg['Servers'][$i]['auth_type'] = 'cookie';

req.Proxy=null;

或者在app.config

<configuration>  
  <system.net>  
    <defaultProxy  
        enabled="false"  
        useDefaultCredentials="false" >  
    </defaultProxy>  
  </system.net>  
</configuration>

原理就是读取系统事件日志 EventLog,事件相关信息也可以在事件查看器 eventvwr.msc 里找到。eventID 和 InstancedId 并不是一定相同的,事件查看器里只能看到 eventId。

Get-EventLog -LogName system | where {$_.eventID -eq 12} | format-list -property TimeGenerated
Get-EventLog -LogName system -InstanceId 12 | format-list -property TimeGenerated