小编Bal*_*ran的帖子

如何从消息和文本中删除“ System.Windows.Forms.TextBox,文本:”

我用C#编写了一个简单的程序,其中

  1. 使用如下语句显示消息:
    {
     MessageBox.Show("Enter the Correct Values. ", "Error", 
                     MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     return;
    }
Run Code Online (Sandbox Code Playgroud)
  1. 一些文本框内容使用StreamWriter写入文本文件。在这两种情况下,除了正确的内容之外,我还获得了前缀:System.Windows.Forms.TextBox,Text:

  2. 使用StreamReader读取文本文件的内容时,得到类似的前缀(后缀为\ r \ n)。

如何避免这种情况?

c# message system

1
推荐指数
1
解决办法
9865
查看次数

标签 统计

c# ×1

message ×1

system ×1