C# 域网络中的文件搜索
我想在文件中搜索一个字符串,我知道该字符串在计算机中的位置,即文件名和文件夹名。文件可以存在于域上的任何计算机中。文件和关键字可以多次出现 这是我写的代码:C# 域网络中的文件搜索,c#,visual-studio,C#,Visual Studio,我想在文件中搜索一个字符串,我知道该字符串在计算机中的位置,即文件名和文件夹名。文件可以存在于域上的任何计算机中。文件和关键字可以多次出现 这是我写的代码: namespace newprog { class Program { static void Main(string[] args) { string[] dirs = Directory.Getfiles("C:\ABC"); Console.WriteLine("Results {0}
namespace newprog
{
class Program
{
static void Main(string[] args)
{
string[] dirs = Directory.Getfiles("C:\ABC");
Console.WriteLine("Results {0}", dirs.Length);
try
{
foreach (string dir in dirs)
{
Console.WriteLine(dir);
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}
在上面的代码中,我在本地目录(即ABC)中找到了文件。但是现在我想从整个域的所有计算机中搜索一个特定的文件,还需要检查找到的文件中是否存在关键字
我的域名是pqr.rst.com,我想知道ab.txt文件。那么如何使用getfiles命令呢
我所知道的
任何帮助都将不胜感激。提前谢谢。到目前为止你都试了些什么?请张贴您已经编写的代码,并指出您被卡住的部分,以便我们可以帮助您。