2009-10-07 110 views

回答

1

这只是一个文本文件。在文本编辑器中打开它并查看。你正在寻找所有的项目指令。编写一个简单的解析器来提取* .vcproj名字应该不难。

2

这个数组将会给你完整的解决方案的细节用在解决方案中创建项目...

public List<string> getAllProjectNames(string path) 
    { 
     string[] arr = System.IO.File.ReadAllLines(path); 
     List<string> projects = new List<string>(); 
     for (int i = 0; i < arr.Length; i++) 
     { 
      if (arr[i].StartsWith("Project")) 
      { 
       string [] temp = arr[i].Split(','); 
       projects.Add(temp[1]); 
      } 
     } 
     return projects; 
    } 

调用此方法像...

List<string> Arr = getAllProjectNames(@"D:\Projects\PersonalRD\SearchingList\SearchingList.sln"); 

后,尝试搜索所有项目名称字符串项目以项目开头...

相关问题