在a中switch,如果我们写任何单词或单个字母而不是default 它不会抛出错误.例如
switch(10)
{
case 1:
break;
hello:
break;
}
Run Code Online (Sandbox Code Playgroud)
它运行时没有抛出错误.
谁能解释一下这是如何工作的?
我有在本地系统帐户下运行的 Windows 服务。我正在检查 File.Exist(网络中的文件)。这适用于用户帐户,但它在本地系统帐户中为 file.exists() 返回 false。我无法使用用户帐户运行服务。提前致谢。
protected override void OnStart(string[] args) {
m_objLogFile.LogError("******************Servicestarted*****************", "", "");
Thread th = new Thread(new ThreadStart(StartIndexing));
th.Start();
}
private void StartIndexing()
{
bool bVal = File.Exists(@"100.100.1.1\f\Files\abc.txt");
}
Run Code Online (Sandbox Code Playgroud)