Get-Set属性返回null
这是一件非常简单的事情,我尝试了与从表格中发现的相同的事情,几次我将其无效,
public class Variables_Log
{
private int_Type_Parameter_Log;
public int Type_Parameter_Log
{
get
{
return _Type_Parameter_Log;
}
set
{
_Type_Parameter_Log= value;
}
}
}
这是我在表单中使用的部分。
public partial class Form1 : Form
{
Variables_Log variables_log = new Variables_Log();
public void Write_Parameter_Log()
{
public string Log_Raw = "";
FileStream fs = new FileStream("C:\\Users\\ASUS\\Desktop\\CAS_CW1 -
ORJINAL\\CAS_CW1\\Log_Parameter.txt", FileMode.Append,
FileAccess.Write, FileShare.Write);
variables_Log.Type_Parameter_Log = "INFO";
StreamWriter sw = new StreamWriter(fs);
if (fs != null)
{
Log_Raw = (variables_Log.Type_Parameter_Log);
sw.WriteLine(Log_Raw);
sw.Close();
}
}
}
在这里,我正在更改值,但在其他类中没有更改。 我无法解决问题
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是简单的记录器。您可以将此概念用于问题。
Here is simple logger. you can use this concept for your problem.
Github code