簡體   English   中英

如何將文件附加到Mantis Connect mc_issue_add

[英]How to attach files to Mantis Connect mc_issue_add

我想知道是否可以在MantisConnect上使用文件名附加文件。 我試過ff沒有運氣。

var mc = new MantisBt.Service.Client.MantisBt.Api.MantisConnect();
IssueData iIssue = new IssueData() {
    //some other properties here...
    attachments = new AttachmentData[] { 
                          filename = "path-to-my-attachment",
                          date_submitted = DateTime.Now 
                  }
};
string issueID = mc.mc_issue_add(MyUserID, MyPassword, iIssue);

該問題已發布在Mantis中,但未添加附件。 我確定"path-to-my-attachment"存在: (FileInfo.Exists == true)

我也嘗試過:

IssueData iIssue = new IssueData();
//some other properties here
iIssue.attachments = 
//tried converting a List<AttachmentData> to array
//tried the usual AttachmentData[] method
//tried adding AttachmentData["length here"]

但同一件事,問題已發布,未添加附件。

任何人?

您要查找的功能是mc_issue_attachment_addmc_issue_addmc_issue_update不允許添加附件。

我發現以某種方式填充IssueData的附件屬性並通過mc_issue_addmc_issue_update保存問題不會保存附件。 唯一的方法是先保存問題,使用ID然后使用mc_issue_attachment_add

所以不行。 您不能使用attachments屬性添加批量附件。 您需要使用mc_issue_attachment_add一對一添加它們。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM