string fileName = AppDomain.CurrentDomain.BaseDirectory + "\\log.txt";
File.AppendAllText(fileName, "start\r\n", Encoding.UTF8);

version 6.0.0.0 need set ExceptionManager
PM>  Install-Package EnterpriseLibrary.Logging
PM>  Install-Package EnterpriseLibrary.Common
PM>  Install-Package EnterpriseLibrary.ExceptionHandling
PM>  Install-Package EnterpriseLibrary.ExceptionHandling.Logging

Microsoft.Practices.EnterpriseLibrary.ConfigConsoleV6.vsix。这个工具的下载地址:http://www.microsoft.com/en-us/download/details.aspx?id=38789

<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" /> using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Logging;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration; static AppLogger()
{
Logger.SetLogWriter(new LogWriterFactory().Create());
IConfigurationSource config = ConfigurationSourceFactory.Create();
ExceptionPolicyFactory factory = new ExceptionPolicyFactory(config); ExceptionManager exManager = factory.CreateManager();
ExceptionPolicy.SetExceptionManager(factory.CreateManager());
} public static void LogError(Exception ex)
{
lock (staticLock)
{ ExceptionPolicy.HandleException(ex, AppConfiguration.ExceptionPolicyName);
}
}

App.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Common.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<container>
<register type="Common.Interfaces.IGetServiceResponseBLL,R365.Common" mapTo="Common.BusinessLogic.CallTestBLL,Common" />
</container>
</unity>
<applicationSettings>
<Common.Properties.Settings> </Common.Properties.Settings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source="test Logging" formatter="Text Formatter"
log="" machineName="." traceOutputOptions="None" />
<add name="Email Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
toAddress="test@test.com.cn" fromAddress="test@test.com.mo"
subjectLineStarter="[test] " subjectLineEnder="- DEV"
smtpServer="smtpserver.test.com.cn" formatter="Text Formatter" />
        <add name="Database Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                databaseInstanceName="TestConnectionString" writeLogStoredProcName="WriteLog" 
                addCategoryStoredProcName="AddCategory" formatter="Text Formatter" traceOutputOptions="None" />
</listeners>
<formatters>
<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
template="Timestamp: {timestamp}{newline}
Message: {message}{newline}
Category: {category}{newline}
Priority: {priority}{newline}
EventId: {eventid}{newline}
Severity: {severity}{newline}
Title:{title}{newline}
Machine: {localMachine}{newline}
App Domain: {localAppDomain}{newline}
ProcessId: {localProcessId}{newline}
Process Name: {localProcessName}{newline}
Thread Name: {threadName}{newline}
Win32 ThreadId:{win32ThreadId}{newline}
Extended Properties: {dictionary({key} - {value}{newline})}"
name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Event Log Listener" />
</listeners>
</add>
<add switchValue="All" name="Error">
<listeners>
<add name="Event Log Listener" />
<add name="Email Trace Listener" />
           <add name="Database Trace Listener"/>
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Event Log Listener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
<exceptionHandling>
<exceptionPolicies>
<add name="Exception Policy">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="NotifyRethrow">
<exceptionHandlers>
<add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
logCategory="Error" eventId="100" severity="Error" title="Exception Handling"
formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
priority="0" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
<add name="Log Only Policy">
<exceptionTypes>
<add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="None">
<exceptionHandlers>
<add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
logCategory="Error" eventId="100" severity="Error" title="Exception Handling"
formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
priority="0" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy usesystemdefault="False" proxyaddress="http://proxyip:80" bypassonlocal="True" />
</defaultProxy>
</system.net>
</configuration>

AppLogger.cs

    public static class AppLogger
{
private static Object staticLock = new object(); static AppLogger()
{
Logger.SetLogWriter(new LogWriterFactory().Create());
IConfigurationSource config = ConfigurationSourceFactory.Create();
ExceptionPolicyFactory factory = new ExceptionPolicyFactory(config); ExceptionManager exManager = factory.CreateManager();
ExceptionPolicy.SetExceptionManager(factory.CreateManager());
} public static void LogError(Exception ex)
{
lock (staticLock)
{ ExceptionPolicy.HandleException(ex, AppConfiguration.ExceptionPolicyName);
}
} public static void LogErrorOnly(Exception ex)
{
lock (staticLock)
{
try
{
ExceptionPolicy.HandleException(ex, AppConfiguration.LogOnlyPolicyName);
}
catch(Exception excep) {
LogHelper.LogInfo(excep.Message);
}
}
} public static bool HandleException(Exception ex, string exceptionPolicyName)
{
lock (staticLock)
{
return ExceptionPolicy.HandleException(ex, exceptionPolicyName);
}
} public static void Write(object message)
{
lock (staticLock)
{
Logger.Write(message);
}
} public static void Write(object message, string category)
{
lock (staticLock)
{
Logger.Write(message, category);
}
} public static void Write(object message, TraceEventType severity)
{
lock (staticLock)
{
LogEntry entry = new LogEntry();
entry.Message = message == null ? "" : message.ToString();
entry.Severity = severity;
Logger.Write(entry);
}
} public static void Debug(object message)
{
lock (staticLock)
{
string msg = string.Format("[{0:yyyy/MM/dd HH:mm:ss.fff}] {1}", DateTime.Now, message);
try
{
System.Diagnostics.Debug.WriteLine(msg);
}
catch (Exception ex)
{
LogErrorOnly(new ApplicationException(string.Format("Could not write debug message: {0}", msg), ex));
}
}
}
}

LogFormatHelper.cs

    public class LogFormatHelper
{
public static string GetMethodDetail(MethodBase method){
// MethodBase.GetCurrentMethod().Name;
StringBuilder methodDetail = new StringBuilder(method.Name); ;
ParameterInfo[] paras = method.GetParameters();
StringBuilder parasStr = new StringBuilder();
foreach (ParameterInfo para in paras)
{
parasStr.Append(string.Format("{0} {1},",para.ParameterType.Name.ToString(),para.Name));
}
if( paras.Length > 0) parasStr.Remove(parasStr.Length - 1, 1);
methodDetail.Append("(").Append(parasStr.ToString()).Append(")");
return methodDetail.ToString();
} public static Dictionary<string, string> GetLogInfo(string methodName)
{
Dictionary<string, string> dics = new Dictionary<string, string> { { "MethodName", methodName }, { "SwitchUserPermission", WebHelper.SwitchUserPermission.ToString() }, { "FactoAd", WebHelper.FactoAd }, { "CurrentAd", WebHelper.CurrentAd }, { "TM", WebHelper.CurrentTm } };
return dics;
} public static Dictionary<string, string> GetLogInfo(string methodName, TimeSpan elapsed)
{
Dictionary<string, string> dics = GetLogInfo(methodName);
dics.Add("RequestElapsed", elapsed.ToString());
return dics;
} public static void LogServiceError(Exception ex, string methodName, params object[] objs)
{
try
{
Dictionary<string, string> dics = LogFormatHelper.GetLogInfo(methodName);
LogServiceError(ex, dics,objs);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogServiceError(Exception ex, string methodName, TimeSpan elapsed, params object[] objs)
{
try
{
Dictionary<string, string> dics = LogFormatHelper.GetLogInfo(methodName, elapsed);
LogServiceError(ex, dics, objs);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogServiceError(Exception ex, Dictionary<string, string> dics, params object[] objs)
{
try
{
AddParametersToError(ex, dics , objs);
AppLogger.LogError(ex);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogFunction(string functionName)
{
try
{
AppLogger.Write(functionName);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogFunction(string functionName, TimeSpan elapsed)
{
try
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("FunctionName:{0}\r\nFunctionElapsed:{1}\r\n", functionName, elapsed);
AppLogger.Write(sb);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogRequestParams(string methodName, params object[] objs)
{
try
{
Dictionary<string, string> dics = GetLogInfo(methodName);
LogRequestParams(dics, objs);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogRequestParams(string methodName, TimeSpan elapsed , params object[] objs)
{
try
{
Dictionary<string, string> dics = GetLogInfo(methodName, elapsed);
LogRequestParams(dics, objs);
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogRequestParams(Dictionary<string,string> dics, params object[] objs)
{
try
{
StringBuilder sb = new StringBuilder();
foreach (var dic in dics)
{
sb.AppendFormat("{0} = {1}", dic.Key, dic.Value).AppendLine();
//LogRequestParams(obj);
}
sb.Append("Other objects =").AppendLine();
foreach (object obj in objs)
{
LogRequestParams(sb ,obj);
}
AppLogger.Write(sb.ToString());
}
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void LogRequestParams(StringBuilder sb,object obj)
{
try
{
Dictionary<string, object> result = BuildParametersDictionary(obj, "");
// StringBuilder sb = new StringBuilder();
// if (elapsed != null) sb.AppendFormat("Request Elapsed: {0}", elapsed).AppendLine();
sb.AppendFormat("{0}:", obj.GetType().Name).AppendLine();
foreach (var p in result)
{
sb.AppendFormat("{0} = {1}", p.Key, p.Value).AppendLine();
} }
catch (Exception innerExp)
{
innerExp.Data.Add("Logger error", innerExp.Message);
AppLogger.LogError(innerExp);
}
} public static void AddParametersToError(Exception ex, Dictionary<string,string> dics ,params object[] objs)
{
foreach (var dic in dics)
{
ex.Data.Add(dic.Key, dic.Value);
} foreach (object obj in objs)
{
AddParametersToError(ex,obj,"");
} } public static void AddParametersToError(Exception ex, object obj, string propertyNamePrefix)
{
if (obj == null)
return; Dictionary<string, object> parameters = BuildParametersDictionary(obj, propertyNamePrefix);
foreach (var p in parameters)
{
ex.Data.Add(p.Key, p.Value);
}
} private static Dictionary<string, object> BuildParametersDictionary(object obj, string propertyNamePrefix)
{
Dictionary<string, object> result = new Dictionary<string, object>();
if (obj == null)
return result; if (obj is string || obj is DateTime || obj is Boolean)
{
result.Add(obj.GetType().ToString(), obj.ToString());
return result;
} var properties = obj.GetType().GetProperties();
foreach (PropertyInfo p in properties)
{
Type pType = p.GetType();
object pValue = p.GetValue(obj, null);
if (pValue == null)
{
string pName = string.IsNullOrEmpty(propertyNamePrefix) ? p.Name : propertyNamePrefix + "." + p.Name;
result.Add(pName, "null");
}
else if (pType.IsValueType || pValue is string || pValue is DateTime || pValue is Boolean)
{
string pName = string.IsNullOrEmpty(propertyNamePrefix) ? p.Name : propertyNamePrefix + "." + p.Name;
if (p.Name.ToLower() == "password" || p.Name.ToLower() == "dateofbirth" || p.Name.ToLower() == "encrykey")
result.Add(pName, "******");
else
result.Add(pName, pValue);
}
else if (pType.FullName.Contains(typeof(List<>).FullName))
{
var list = obj as System.Collections.ICollection;
if (list != null && list.Count > 0)
{
int index = 0;
foreach (object objInList in list)
{
if (objInList is ValueType || objInList is string)
result.Add(p.Name + "[" + index.ToString() + "]", objInList);
else
{
Dictionary<string, object> childResult = BuildParametersDictionary(objInList, p.Name + "[" + index.ToString() + "]");
foreach (var e in childResult)
{
result.Add(e.Key, e.Value);
}
}
index++;
}
}
}
else if (pValue.GetType().FullName.Contains(typeof(List<>).FullName))
{
var list = pValue as System.Collections.ICollection;
if (list != null && list.Count > 0)
{
int index = 0;
foreach (object objInList in list)
{
if (objInList is ValueType || objInList is string)
result.Add(p.Name + "[" + index.ToString() + "]", objInList);
else
{
Dictionary<string, object> childResult = BuildParametersDictionary(objInList, p.Name + "[" + index.ToString() + "]");
foreach (var e in childResult)
{
result.Add(e.Key, e.Value);
}
}
index++;
}
}
}
}
return result;
}
}

string methodName =  LogFormatHelper.GetMethodDetail(MethodBase.GetCurrentMethod());
           LogFormatHelper.LogRequestParams(methodName, objectname);

VS - Microsoft.Practices.EnterpriseLibrary.Logging的更多相关文章

  1. Microsoft.Practices.EnterpriseLibrary.Logging的使用

    翻译 原文地址:http://www.devx.com/dotnet/Article/36184/0/page/1  原文作者:Thiru Thangarathinam (好强大的名字) 翻译: fl ...

  2. Microsoft.Practices.EnterpriseLibrary企业库问题

    System.Configuration.ConfigurationErrorsException: Invalid TraceListenerData type in configuration ' ...

  3. Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, ...

    使用oracle数据库一个多月依赖这问题一直都得不到解决,最近任务不是很忙了,所以决定把这问题解决掉.写一篇文章做记录. 以上错误主要是net程序oracle数据库使用了Microsoft Enter ...

  4. Microsoft.Practices.EnterpriseLibrary

    项目中使用了Microsoft.Practices.EnterpriseLibrary这个东西,根据名字猜测和微软有关系(可以翻译为:微软实践企业库). 看到了引入了两个命名空间: using Mic ...

  5. 缓存篇~第六回 Microsoft.Practices.EnterpriseLibrary.Caching实现基于方法签名的数据集缓存

    返回目录 这一讲中主要是说EnterpriseLibrary企业级架构里的caching组件,它主要实现了项目缓存功能,它支持四种持久化方式,内存,文件,数据库和自定义,对于持久化不是今天讨论的重要, ...

  6. 错误:创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Caching,

    问题: 错误:创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibrary.Caching ...

  7. c# 之 Microsoft.Practices.EnterpriseLibrary连接Oracle

    首先下载Microsoft Enterprise Library 5.0:http://www.microsoft.com/en-us/download/details.aspx?id=15104,这 ...

  8. 在WebService中使用Microsoft.Practices.EnterpriseLibrary.Data配置数据库

    1. 新建WebApplication1项目 1.1 新建—Web—ASP.NET Empty Web Application--WebApplication1 1.2 添加一个WebForm1 2. ...

  9. 第九回 Microsoft.Practices.Unity.Interception实现基于数据集的缓存(针对六,七,八讲的具体概念和配置的解说)

    返回目录 概念 Microsoft.Practices.Unity.Interception是一个拦截器,它隶属于Microsoft.Practices.Unity组成之中,主要完成AOP的功能,而实 ...

随机推荐

  1. 使用Git管理版本

    原文地址:廖雪峰的网站 Git 是目前世界上最先进的分布式版本控制系统 Git 的历史 集中式 vs 分布式 集中式的版本库是集中存放在中央服务器的.缺点是必须联网.网速慢的情况就会让人抓狂. 分布式 ...

  2. MY SQL 两种安装方式

    MySQL基础知识-安装MySQL   前导: 昨天去参加了一个面试,公司不太大,是一家日资企业,在国内有几家分公司,面试官问到了MySQL的基本操作和性能优化,说了一大堆,倒是比较轻松的过了,但是面 ...

  3. Webform中的前后端分离

    Webform常用的开发方式 (1)运用服务器端控件的aspx页面 (2)一般处理程序+html静态页面+Ajax(所谓的前后端分离) (3)一般处理程序+html模板引擎   这里简单记录html+ ...

  4. 1 集群状态、增删改查、全量替换、强制创建、设置单个index的分片数副本数

    检查集群健康状态,可以看集群颜色.(黄色:primary shard都正常,replica不正常) GET /_cat/health?v 列出集群所有index GET /_cat/indices?v ...

  5. fatal: 不是一个有效的对象名:'master'。

    听说git比svn的branch功能好,所以装了个msysgit玩.执行完了git init操作后想建branch,用git branch develop命令,结果报错,说 fatal: Not a ...

  6. node的启动环境

    在开发的时候开发环境和正式环境用的接口地址是不一样的端口号可能也不一样,这时候就需要区分端口号,具体方法如下: 在package.json文件的scripts中设置启动命令的时候区分开发和正式: &q ...

  7. SpringBoot+SpringCloud+vue+Element开发项目——集成MyBatis框架

    添加mybatis-spring-boot-starter依赖 pox.xml <!--mybatis--> <dependency> <groupId>org.m ...

  8. 输入web网站点击之后发生的事情

    (1)用户在浏览器(客户端)里输入或者点击一个连接: (2)浏览器向服务器发送HTTP请求: (3)服务器处理请求,如果查询字符串或者请求体里含有参数,服务器也会把这些参数信息考虑进去: (4)服务器 ...

  9. 用于并发系统建模和验证的着色Petri网及其工具软件的CPN Tools(笔记整理)

    1.着色Petri网(CPNS)是一种建模和验证系统的语言,在这些熊中并发性,交互性和同步性扮演着主要的角色,着色Petri网是一种功能编程语言Standard ML结合起来的离散时间建模语言,Pet ...

  10. Java Decompiler反编译Jar文件

    1.重新编译已经打包的Jar包,使用 Java Decompiler 打开需要重新编译的jar包,找到自己需要自己修改的Class文件 ,修改之后电子保存文件 ,保存的时候编译工具自动将class文件 ...