public Document [] Documents - 如何提供文档的路径 [英] public Document[] Documents - how do I provide a path to the document

查看:60
本文介绍了public Document [] Documents - 如何提供文档的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


你好,

我做错了什么



推荐答案

除了属性定义之外,您没有提供任何信息。如果您指的是您在上一个代码段中所做的分配,那么错误就是您正在尝试将字符串(.Text)转换为Document []数组,即Document类型。这不是
允许的。由于我们不知道Document是什么样的,所以我只能说你需要创建一个数组然后创建一个Document实例,然后设置Document的任何属性对应于你引用的.Text字段。

You didn't provide any information beyond a property definition. If you're referring to the assignment you did in the previous snippet then the error is that you're trying to convert a string (.Text) to a Document[] array, the type of Documents. That isn't allowed. Since we don't know what Document looks like, all I can say is that you'll need to create an array and then a Document instance and then set whatever property of Document corresponds to the .Text field you're referencing.

sendOutBoundFAX.Documents = new [] {
   new Document() { SomeStringProperty = textBoxDoc1.Text }
};


当然,如果您尝试一次发送多个文档,则上述语法将无效,因为您将消除以前的数组元素。在这种情况下,您需要预先分配数组,然后使用索引来设置每个元素。

Of course, if you're trying to send more than 1 document at once then the above syntax won't work as you'll be wiping out the previous array elements. In that case you'll want to pre-allocate the array and then use an index to set each element.


这篇关于public Document [] Documents - 如何提供文档的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆