博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
What is base..ctor(); in C#?
阅读量:6612 次
发布时间:2019-06-24

本文共 1398 字,大约阅读时间需要 4 分钟。

I am disassembling some C# applications and I am trying to reconstruct the source code. I am disassembling the application along with the required DLLs.

I keep coming across this line base..ctor(); which gives me an error. The line occurs in some voids with in some subclasses of Stream and Exception.

Does anyone have any idea what the code should be? I am thinking the disassembler messed it up some how and it is clearly invalid code. So does anyone know what it is meant to mean and how I can change the line so it works?

Here is the code of one of the subclasses that line occurs in:

[Guid("ebc25cf6-9120-4283-b972-0e5520d0000E")]public class ZlibException : Exception{    public ZlibException()    {        base..ctor();        return;    }    public ZlibException(string s)    {        base..ctor();        return;    }}

It should be :

[Guid("ebc25cf6-9120-4283-b972-0e5520d0000E")]public class ZlibException : Exception{    public ZlibException() : base()    {        return;    }    public ZlibException(string s) : base()    {        return;    }}

Which calls the constructor with that signature on the base implementation of this class.

But by default the .NET CLR calls the base, blank constructor for you, so you don't actually need the : base()

 原文地址:http://stackoverflow.com/questions/18150628/what-is-base-ctor-in-c

 

网名:浩秦; 邮箱:root#landv.pw; 只要我能控制一個國家的貨幣發行,我不在乎誰制定法律。金錢一旦作響,壞話隨之戛然而止。

转载地址:http://oyoso.baihongyu.com/

你可能感兴趣的文章
【第8章】JVM内存管理
查看>>
在绿色的河流上
查看>>
ovirt官方安装文档 附录G
查看>>
磁盘故障小案例
查看>>
了解相关.NET Framework不同组件区别及安装知识
查看>>
ToughRADIUS快速指南
查看>>
HTML
查看>>
【转】左手坐标系和右手坐标系
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
POJ 3335 Rotating Scoreboard 半平面交
查看>>
window.location.href和window.location.replace的区别
查看>>
《Gamestorming》读书笔记
查看>>
域名和网址链接被微信浏览器拦截怎么办 微信屏蔽网址打开如何解决
查看>>
使用SQL Server Analysis Services数据挖掘的关联规则实现商品推荐功能(二)
查看>>
ubuntu下安装jdk
查看>>
C/S与B/S架构比较
查看>>
XML学习总结(2)——XML简单介绍
查看>>
python操作数据库-安装
查看>>
你真的了解interface和内部类么
查看>>