C# 使用变更列表编号获取文件规范

C# 使用变更列表编号获取文件规范,c#,.net,perforce,C#,.net,Perforce,我必须使用changeid提取文件规范这些文件规范与我拥有的变更列表中更改的文件相关 我用这个密码试过了 string change = value; Options optionfilespec = new Options(); optionfilespec.Add(id.ToString(),""); P4Command commadfilespec = new P4Command(ps, "where", true, change); P4CommandResult res= commad

我必须使用changeid提取文件规范这些文件规范与我拥有的变更列表中更改的文件相关 我用这个密码试过了

string change = value;
Options optionfilespec = new Options();
optionfilespec.Add(id.ToString(),"");
P4Command commadfilespec = new P4Command(ps, "where", true, change);
P4CommandResult res= commadfilespec.Run(optionfilespec);
或者我可以用这个吗

int id = int.Parse(change);
Changelist changelist= rep.GetChange(id);
IList <Perforce.P4.FileMetaData> files= changelist.Files;
foreach (FileMetaData fmd in files)
{ 
            //get the depot path and create instances from filespec            

}
int id=int.Parse(更改);
Changelist Changelist=rep.GetChange(id);
IList files=changelist.files;
foreach(文件中的文件元数据fmd)
{ 
//从filespec获取仓库路径并创建实例
}

后一种方法是您想要的。我不确定您的代码片段是否100%正确,但方法是正确的。

后一种方法就是您想要的。我不确定您的代码片段是否100%正确,但方法是正确的。

第二种方法是正确的

int id = int.Parse(change);
Changelist changelist= rep.GetChangelist(id);
IList <Perforce.P4.FileMetaData> files= changelist.Files;
foreach (FileMetaData fmd in files)
    { 
                //get the depot path and create instances from filespec            

    }
int id=int.Parse(更改);
Changelist Changelist=rep.GetChangelist(id);
IList files=changelist.files;
foreach(文件中的文件元数据fmd)
{ 
//从filespec获取仓库路径并创建实例
}

第二种方法是正确的

int id = int.Parse(change);
Changelist changelist= rep.GetChangelist(id);
IList <Perforce.P4.FileMetaData> files= changelist.Files;
foreach (FileMetaData fmd in files)
    { 
                //get the depot path and create instances from filespec            

    }
int id=int.Parse(更改);
Changelist Changelist=rep.GetChangelist(id);
IList files=changelist.files;
foreach(文件中的文件元数据fmd)
{ 
//从filespec获取仓库路径并创建实例
}