我想打开文本文件并将其加载到RichTextBox中。到目前为止,一切都很好,但是现在我在编码问题上苦苦挣扎。
因此,我在此StackOverflow页面上使用了GetType()方法: 如何找出文件的编码?C# -它返回“ System.Text.UnicodeEncoding”。
我的问题是:
rtb.LoadFile(aFile, RichTextBoxStreamType.PlainText);
我一直在摸索这个问题一个小时了,我无法弄清楚为什么Radiobuttons出现这种奇怪的行为.以下是我的代码:
<label>Language
<input type="radio" id="de" value="de" onclick="switchRadioButtons(this);" >de
<input type="radio" id="en" value="en" onclick="switchRadioButtons(this);" >en
<input type="radio" id="other" value="other" onclick="switchRadioButtons(this);" >other
<input type="text" id="language" value="" /><br />
</label>
<script>
function switchRadioButtons(element) {
console.log(element.value);
</script>
Run Code Online (Sandbox Code Playgroud)
因此,在我看来,每当我点击值或按钮本身时,应将radiobutton的值写入控制台.这对于按钮本身是正常的,但如果我点击按钮旁边的标签/描述,它将始终打印"de"(第一项),无论我做什么(我也尝试过"switchRadioButtons(document.getElementById( '其他'));"没有效果".
谁能解释为什么会发生这种情况并提供解决方案?
c# ×2
dll ×1
encoding ×1
html ×1
ilmerge ×1
javascript ×1
merge ×1
richtextbox ×1
text ×1
utf-8 ×1