我是c#的初学者,对学习c#非常感兴趣,但我很困惑.当我问一个人在功能和方法之间有什么区别时,他告诉我没有区别,他们都有相同的功能.
现在我很困惑,想从优秀的开发人员那里了解哪些方法和功能?
他们俩都一样吗?如果没有,那么我如何初始化每一个?
这种方式初始化函数是否正确?
public void UpdateLeaveStatus(EmployeeLeave objUpdateLeaveStatus)
Run Code Online (Sandbox Code Playgroud)
我是新人,请提供适当的帮助.
我正在尝试允许用户将数据输入到将添加到web.config文件的文本框中.我已经将相关的行添加到web.config文件中,但是当我使这个类出错时.
每当我尝试运行我的应用程序时,我总是得到你错过了using指令或程序集refenrence错误.我已经看过其他时候这个问题已被问到,似乎无法弄清楚我哪里出错了.问题是我对Visual Studio来说是一个非常新的东西,我只是留下了可能的答案.
下面是生成错误的类文件.我希望我已经包含了你需要的一切来帮助我.谢谢.
using System.Collections.Generic;
using System.Linq;
using System.Configuration;
namespace WebConfigDemo
{
public class CompanyConfigSection : ConfigurationSection
{
[ConfigurationProperty("", IsRequired = true, IsDefaultCollection = true)]
public CompanyConfigCollection Companies
{
get
{
return (CompanyConfigCollection)this[""];
}
set
{
this[""] = value;
}
}
}
public class CompanyConfigElement : ConfigurationElement
{
[ConfigurationProperty("id", IsKey = true, IsRequired = true)]
public int Id
{
get
{
return (int)this["id"];
}
set
{
this["id"] = value;
}
}
[ConfigurationProperty("name", IsRequired = true)]
public string Name
{ …Run Code Online (Sandbox Code Playgroud)