ASP.NET对原有项目二次开发,没有.cs文件,只有bin下面的dll文件
ASP.NET对原有项目二次开发,没有.cs文件,只有bin下面的dll文件,现在有数据结构变化,需要在.cs文件中做修改,我该怎么处理?
...全文
请发表友善的回复…
发表回复
Squall001 2018-03-04
- 打赏
- 举报
21楼正解,否则,呵呵~~~~~~~
yzf86211861 2018-02-28
- 打赏
- 举报
重来来呗 反编译 出来的 东西 基本不能看
zjqxwgm 2018-02-28
- 打赏
- 举报
我是在网上找了别人比较完善的项目,然后把DLL文件转换成CS文件,再拿来改,反正是在学习,所以也就一页一页的看,一页一页的改
Jason_Mao1 2018-02-28
- 打赏
- 举报
你这确实不叫二次开发,你这直接是破解人家代码呢 。如果工作量小你可以照着人家的实现一遍,如果工作量大 希望你还是通过正规渠道去获取代码。
woyaodubo 2018-02-28
- 打赏
- 举报
这不叫二次开发吧,二次开发有两种,一种是在源代码的基础上增加功能,另外一种是对接口的扩展,比如微信二次开发,那个你是没有源代码的。
流星亚瑟 2018-02-27
- 打赏
- 举报
若修改量不大的话,可以尝试以下方法,
将原dll作为外部类库引用,
需要修改的页面可以新建个类继承原dll的类,通过override重写原逻辑,aspx页面中改成使用新的继承类
这样就可以简单的修改页面逻辑。
如果改动太大,还是……呵呵
月夜惹人醉 2018-02-26
- 打赏
- 举报
没有源代码,那估计开发文档、开发思路什么的你都没有了,只有发布出来的东西还不如重新开发容易
春天的气息 2018-02-18
- 打赏
- 举报
重新找一个有cs文件的吧,,,,
lichsoj 2018-02-18
- 打赏
- 举报
你需要使用一些工具 如reflector 或楼上提到的软件把源代码反编译,还原出原项目文件和结构。然后再看能不能进行改。
工程难度较大。
by_封爱 2018-02-02
- 打赏
- 举报
离职吧

likevs 2017-12-29
- 打赏
- 举报
你拿到的是编译后的文件,没法二次开发
NET程序 2017-12-26
- 打赏
- 举报
新人蹭分~~~~~~~~~~~~
大葡萄八块一斤 2017-12-26
- 打赏
- 举报
没有前人的轮子,哪来的二次开发

秋的红果实 2017-12-26
- 打赏
- 举报
找找原来的dll文档,或许本来就支持二次开发的,无需反编译
「已注销」 2017-12-26
- 打赏
- 举报
1.要源码 2.重新设计开发 3.推掉 4.反向工程不如跑路
正怒月神 版主 2017-12-26
- 打赏
- 举报
没有源码,这叫二次开发吗?
我是不信的。
反编译吧。
以专业开发人员为伍 2017-12-26
- 打赏
- 举报
给你举个例子
using Common;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
namespace BWServer2017.BLL
{
[CommunicationCommand("bw.获取统计数据4")]
class Calc4 : CommandV5<ExpandoObject>
{
public override ExpandoObject Execute()
{
#if DEBUG
return Execute1();
#else
try
{
return Execute1();
}
catch (Exception ex)
{
Common.Program.WriteObjectLog("bw获取统计数据4", new
{
error = ex.ToString(),
input = this.Command.ToString()
});
throw;
}
#endif
}
private ExpandoObject Execute1()
{
var BaselienDefination = this.Command.GetValue<string>("BaselineDefination");
var DanWei = this.Command.GetValues<string>("DanWei").ToList();
if (DanWei == null || DanWei.Count == 0)
throw new Exception("DanWei参数必须有值。");
var tablename = Common.BLL.ModifyWork.GetTopTableName(BaselienDefination);
var Nian = this.Command.GetValue<int>("Nian");
var YueList = this.Command.GetValues<int>("Yue");
var FieldName = this.Command.GetValues<string>("FieldName").Where(x => !string.IsNullOrEmpty(x)).ToArray();
var r = (from y in YueList.AsParallel()
from dw in DanWei.AsParallel()
let o = BLL.Calc.Search(tablename, dw, Nian, y)
where o != null
select o).ToList();
if (r.Count == 0)
return null;
var res = r.First();
if (r.Count > 1)
{
var dic = (IDictionary<string, object>)res;
for (var i = 1; i < r.Count; i++)
{
var d = (IDictionary<string, object>)r[i];
foreach (var fld in FieldName)
dic[fld] = Convert.ToDouble(dic[fld]) + Convert.ToDouble(d[fld]);
}
}
return res;
}
}
}
反编译using Common;
using Common.BLL;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace BWServer2017.BLL
{
[CommunicationCommand(new string[]
{
"bw.获取统计数据4"
})]
internal class Calc4 : CommandV5<ExpandoObject>
{
[CompilerGenerated]
[Serializable]
private sealed class <>c
{
public static readonly Calc4.<>c <>9 = new Calc4.<>c();
public static Func<string, bool> <>9__1_0;
public static Func<int, string, <>f__AnonymousType1<int, string>> <>9__1_2;
public static Func<<>f__AnonymousType2<<>f__AnonymousType1<int, string>, ExpandoObject>, bool> <>9__1_4;
public static Func<<>f__AnonymousType2<<>f__AnonymousType1<int, string>, ExpandoObject>, ExpandoObject> <>9__1_5;
internal bool <Execute1>b__1_0(string x)
{
return !string.IsNullOrEmpty(x);
}
internal <>f__AnonymousType1<int, string> <Execute1>b__1_2(int y, string dw)
{
return new
{
y,
dw
};
}
internal bool <Execute1>b__1_4(<>f__AnonymousType2<<>f__AnonymousType1<int, string>, ExpandoObject> <>h__TransparentIdentifier1)
{
return <>h__TransparentIdentifier1.o != null;
}
internal ExpandoObject <Execute1>b__1_5(<>f__AnonymousType2<<>f__AnonymousType1<int, string>, ExpandoObject> <>h__TransparentIdentifier1)
{
return <>h__TransparentIdentifier1.o;
}
}
public override ExpandoObject Execute()
{
ExpandoObject result;
try
{
result = this.Execute1();
}
catch (Exception ex)
{
Common.Program.WriteObjectLog("bw获取统计数据4", new
{
error = ex.ToString(),
input = base.Command.ToString()
});
throw;
}
return result;
}
private ExpandoObject Execute1()
{
string BaselienDefination = base.Command.GetValue("BaselineDefination");
List<string> DanWei = base.Command.GetValues("DanWei").ToList<string>();
if (DanWei == null || DanWei.Count == 0)
{
throw new Exception("DanWei参数必须有值。");
}
string tablename = ModifyWork.GetTopTableName(BaselienDefination);
int Nian = base.Command.GetValue("Nian");
IEnumerable<int> arg_BE_0 = base.Command.GetValues("Yue");
IEnumerable<string> arg_B3_0 = base.Command.GetValues("FieldName");
Func<string, bool> arg_B3_1;
if ((arg_B3_1 = Calc4.<>c.<>9__1_0) == null)
{
arg_B3_1 = (Calc4.<>c.<>9__1_0 = new Func<string, bool>(Calc4.<>c.<>9.<Execute1>b__1_0));
}
string[] FieldName = arg_B3_0.Where(arg_B3_1).ToArray<string>();
ParallelQuery<int> arg_EE_0 = arg_BE_0.AsParallel<int>();
Func<int, IEnumerable<string>> arg_EE_1 = (int y) => DanWei.AsParallel<string>();
var arg_EE_2;
if ((arg_EE_2 = Calc4.<>c.<>9__1_2) == null)
{
arg_EE_2 = (Calc4.<>c.<>9__1_2 = new Func<int, string, <>f__AnonymousType1<int, string>>(Calc4.<>c.<>9.<Execute1>b__1_2));
}
var arg_123_0 = from <>h__TransparentIdentifier0 in arg_EE_0.SelectMany(arg_EE_1, arg_EE_2)
select new
{
<>h__TransparentIdentifier0 = <>h__TransparentIdentifier0,
o = Calc.Search(tablename, <>h__TransparentIdentifier0.dw, Nian, <>h__TransparentIdentifier0.y)
};
var arg_123_1;
if ((arg_123_1 = Calc4.<>c.<>9__1_4) == null)
{
arg_123_1 = (Calc4.<>c.<>9__1_4 = new Func<<>f__AnonymousType2<<>f__AnonymousType1<int, string>, ExpandoObject>, bool>(Calc4.<>c.<>9.<Execute1>b__1_4));
}
var arg_147_0 = arg_123_0.Where(arg_123_1);
var arg_147_1;
if ((arg_147_1 = Calc4.<>c.<>9__1_5) == null)
{
arg_147_1 = (Calc4.<>c.<>9__1_5 = new Func<<>f__AnonymousType2<<>f__AnonymousType1<int, string>, ExpandoObject>, ExpandoObject>(Calc4.<>c.<>9.<Execute1>b__1_5));
}
List<ExpandoObject> r = arg_147_0.Select(arg_147_1).ToList<ExpandoObject>();
if (r.Count == 0)
{
return null;
}
ExpandoObject res = r.First<ExpandoObject>();
if (r.Count > 1)
{
IDictionary<string, object> dic = res;
for (int i = 1; i < r.Count; i++)
{
IDictionary<string, object> d = r[i];
string[] array = FieldName;
for (int j = 0; j < array.Length; j++)
{
string fld = array[j];
dic[fld] = Convert.ToDouble(dic[fld]) + Convert.ToDouble(d[fld]);
}
}
}
return res;
}
}
}
这里很显然,最后的那个 for 循环部分,原本只要简单地写一行 Foreach 委托代码就行了,而我当时按照初学者的方式写成比较多行的 fo 循环语句了,所以反编译出来的结果跟源代码比较接近。而其它部分,我就是按照业务逻辑来写,很自然地写成一个 linq 查询,你看看反编译出什么?!
这还只是抠个别语句。而真正的项目需要改造时,其实并不是在于个别语句是不是方便于“城下打洞”的问题,而是要舍得从项目考虑。以专业开发人员为伍 2017-12-25
- 打赏
- 举报
可惜你看到的是破败不堪的 cs 文件。假设编程者都是用了最低级的编程方式,例如从来不会什么 linq、lamda、匿名委托、各种语法糖之类的,那么反编译的代码还看得过去。但是只要稍微高级一点,反编译的东西就面目全非了。
以专业开发人员为伍 2017-12-25
- 打赏
- 举报
这叫做二次开发?
重新从头开始设计开发吧。
江湖评谈 2017-12-25
- 打赏
- 举报
反编译,再编译,再反编译,再编译 循环


加载更多回复(4)