SharePoint Web Service系列: Add或Update其他各种类型的项
在前面,我们讨论了如何Add或Update类型为User的项。因为User类型多少比较特殊。作为SharePoint Web Service系列讨论的结束,我们将讨论各种其他类型的项如何来写。
在SDK中,有如下的一张表格。我们的写法完全是依托在此基础之上。
|
Name |
Format |
|
Attachments |
System.Boolean |
|
Boolean |
System.Boolean |
|
Calculated |
N/A |
|
Choice |
System.String |
|
Computed |
N/A |
|
Counter |
System.Int32 |
|
CrossProjectLink |
System.Boolean |
|
Currency |
System.Double |
|
DateTime |
System.DateTime |
|
GridChoice |
System.String |
|
Guid |
System.Guid |
|
Integer |
System.Int32 |
|
Lookup |
System.String |
|
MaxItems |
System.Int32 |
|
ModStat |
System.Int32 |
|
MultiChoice |
System.String |
|
Note |
System.String |
|
Number |
System.Double |
|
Recurrence |
System.Boolean |
|
Text |
System.String |
|
Threading |
System.String |
|
URL |
System.String, System.String |
|
User |
System.String |
比如,我们现在要Add或Update一个URL类型的字段。可以这样书写Field:
该例中某列表项的SomeUrl字段是链接类型的,我们要写一个链接到这个字段。该链接的地址为“http://www.example.com”,标题为“Example” 。
注意:对于链接类型的字段,由于标题可以不填。(这样系统会默认以地址的内容作标题,这一点和许多文本编辑器相同。)所以上面的例子也可以这样写:
再如,我们现在要Add或Update一个选项类型的字段。可以这样书写Field:
任务列表中的状态字段就是选项类型的,由于其对应的是System.String,所以可以直接这么写。
来源:http://www.cnblogs.com/Sunmoonfire/archive/2006/10/31/545904.html

浙公网安备 33010602011771号