加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何将此构造函数转换为C#?

发布时间:2020-12-16 00:17:28 所属栏目:百科 来源:网络整理
导读:不知道如何将Me.Base转换为C# Imports Microsoft.VisualBasic Public Class ReplaceHTML Inherits System.IO.Stream Private Base As System.IO.Stream Public Sub New(ByVal ResponseStream As System.IO.Stream) If ResponseStream Is Nothing Then Throw
不知道如何将Me.Base转换为C#

Imports Microsoft.VisualBasic  

Public Class ReplaceHTML  
    Inherits System.IO.Stream  

    Private Base As System.IO.Stream  

    Public Sub New(ByVal ResponseStream As System.IO.Stream)  
        If ResponseStream Is Nothing Then 
           Throw New ArgumentNullException("ResponseStream")  
        Me.Base = ResponseStream  
    End Sub  
End Class

完整代码是here

谢谢!

解决方法

尝试使用this.Base

这告诉它使用该类的当前实例

编辑:

有了你更新的问题,我觉得它应该更像

public class ReplaceHTML : System.IO.Stream
{
    private System.IO.Stream Base;
    public ReplaceHTML(System.IO.Stream ResponseStream)
    {
        if (ResponseStream == null)
        {
            throw new ArgumentNullException("ResponseStream");
        }
        this.Base = ResponseStream;
    }
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读