Fork me on GitHub
打赏

错误代码CS0051可访问性不一致_解决方案

一、问题的出现

用C#在写多线程时报错

 

 

二、解决方案

1,分析思路

本来对BaseStruct设置为私有访问,但调用时又想公开化,从而造成了编译错误。

 

2,解决

将红色部分改为公有

 

3,总结

注意public、pravite、和internal关键字的用法

 

三、参考文档

Microsoft Compiler Error CS0051

https://stackoverflow.com/questions/4060703/error-cs0051-inconsistent-accessibility-parameter-type-job-is-less-accessibl

https://github.com/dotnet/docs/blob/master/docs/csharp/language-reference/compiler-messages/cs0051.md

internal(C# 参考)

可访问性级别(C# 参考)

访问修饰符(C# 编程指南)

 

posted @ 2018-07-20 15:52  Zoctopus_Zhang  阅读(2030)  评论(0编辑  收藏  举报
// function btn_donateClick() { var DivPopup = document.getElementById('Div_popup'); var DivMasklayer = document.getElementById('div_masklayer'); DivMasklayer.style.display = 'block'; DivPopup.style.display = 'block'; var h = Div_popup.clientHeight; with (Div_popup.style) { marginTop = -h / 2 + 'px'; } } function MasklayerClick() { var masklayer = document.getElementById('div_masklayer'); var divImg = document.getElementById("Div_popup"); masklayer.style.display = "none"; divImg.style.display = "none"; } setTimeout( function () { document.getElementById('div_masklayer').onclick = MasklayerClick; document.getElementById('btn_donate').onclick = btn_donateClick; var a_gzw = document.getElementById("guanzhuwo"); a_gzw.href = "javascript:void(0);"; $("#guanzhuwo").attr("onclick","follow('33513f9f-ba13-e011-ac81-842b2b196315');"); }, 900);