我的示例代码:
public partial class Service1 : ServiceBase
{
object a = new object ();
static void methodA()
{
string[] tests = {"test1","test2","test3"}
foreach(string test in tests)
{
a.SetValue(""); //object a cannot be seen
}
}
}
Run Code Online (Sandbox Code Playgroud)
无法看到对象.如何在for循环中使用对象?
| 归档时间: |
|
| 查看次数: |
81 次 |
| 最近记录: |