【发布时间】:2016-02-24 18:07:37
【问题描述】:
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] myfunc(string a)
{
// do stuff
}
[] 里面的东西是做什么用的?
【问题讨论】:
[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
public static string[] myfunc(string a)
{
// do stuff
}
[] 里面的东西是做什么用的?
【问题讨论】:
这是一个属性。一般来说,
属性提供了一种关联声明性的强大方法 带有 C# 代码的信息(类型、方法、属性等)。 一旦与程序实体相关联,就可以在以下位置查询该属性 运行时并以多种方式使用。
有关这方面的更多信息,请查看here。
【讨论】: