惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Last Watchdog
The Last Watchdog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
Last Week in AI
Last Week in AI
月光博客
月光博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
博客园 - 叶小钗
NISL@THU
NISL@THU
C
Check Point Blog
K
Kaspersky official blog
N
News and Events Feed by Topic
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
A
Arctic Wolf
T
Threatpost
GbyAI
GbyAI
L
LINUX DO - 热门话题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Scott Helme
Scott Helme
P
Privacy International News Feed
The Register - Security
The Register - Security
G
GRAHAM CLULEY
Recorded Future
Recorded Future
Apple Machine Learning Research
Apple Machine Learning Research
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog
Project Zero
Project Zero
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Microsoft Security Blog
Microsoft Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
D
DataBreaches.Net
J
Java Code Geeks
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Engineering at Meta
Engineering at Meta
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
Google DeepMind News
Google DeepMind News

博客园 - 愚公

Bridges 虚拟化浪潮 MAGEUI的Hash问题 Lingoes的划词翻译功能极有可能泄露隐私 VSTO SaveCopyAs方法在Excel 2007下必须注意的一个问题 Vista Folders Always Shown In Details View - 让Vista文件夹总是使用详细资料视图 用7zip制作自动解压安装程序 安装新的Oracle Instant Client后重新配置PL/SQL Developer和环境: Certificates registry key name to MMC friendly name mapping A review of the CVS SCC PLUGIN IE8.0 TAB行为悄然改善: Set a password textbox for Visual Studio .NET setup project 在WinForm中控制GIF动画的启停的一种方法 foobar2000绿色版在vista下的Unhandled exception: Bad allocation Virtual Server启动时自动启动每个虚机 NTFS文件及目录日期值行为 installState is missing ! .Net Framework 2.0配置工具Stopped Working VISTA BITS POLICY DESCRIPTION'S MISTAKE
WSS 3.0 List WebService使用点滴
愚公 · 2007-10-17 · via 博客园 - 愚公

Text Field全为空格时:<Eq><FieldRef Name='TextFieldName' /><Value Type='Text'></Value></Eq>
Text Field不含任何字符时:<IsNull><FieldRef Name='TextFieldName' ></FieldRef></IsNull>,上条不成立
Text Field不区分英文大小写,这一点应该主要取决于数据库的语言设置。

User Field格式为: UserID;#UserName,如:16;#Leo Ge
如果某个字段为空,则有可能不返回该字段,对XmlNode的Attribute必须先作有效性检验,如:

if (i.Attributes.GetNamedItem("ows_Machine")!=null) taskItem.Machine = i.Attributes["ows_Machine"].Value;

GetListItems的一般性做法:

XmlDocument xmlDoc = new XmlDocument();
XmlElement query 
= xmlDoc.CreateElement("Query");
XmlElement viewFields 
= xmlDoc.CreateElement("ViewFields");
XmlElement queryOptions 
= xmlDoc.CreateElement("QueryOptions");
query.InnerXml 
= "<Where>"
                    
+ "<Or>"
                        
+ "<Eq><FieldRef Name='Machine' /><Value Type='Text'>" + machineName + "</Value></Eq>"
                        
+ "<Or>"
                            
+ "<IsNull><FieldRef Name='Machine'></FieldRef></IsNull>"
                            
+ "<Eq><FieldRef Name='Machine' /><Value Type='Text'></Value></Eq>"
                        
+ "</Or>"
                    
+ "</Or>"
                    
+ "</Where>";
viewFields.InnerXml 
= "";
queryOptions.InnerXml 
= "";
XmlNode node 
= wss.GetListItems("{E7E1EEC8-F627-48A9-8228-F4BC1CA45F0C}""{FC3C7DFF-7399-4944-A155-56AF8BCB0F11}", query, viewFields, "100", queryOptions, null);

NameTable nt 
= new NameTable();
XmlNamespaceManager xnm 
= new XmlNamespaceManager(nt);
xnm.AddNamespace(
"rs""urn:schemas-microsoft-com:rowset");
xnm.AddNamespace(
"z""#RowsetSchema");

xmlDoc 
= new XmlDocument();
xmlDoc.ImportNode(node,
true);

foreach (XmlNode i in node.SelectNodes("rs:data/z:row",xnm))
{
   
int id =int.Parse(i.Attributes["ows_ID"].Value);
   
string title = i.Attributes["ows_Title"].Value;
   
bool reloadData = i.Attributes["ows_Reload_x0020_Data"].Value == "1" ? true : false;
   DateTime created 
= DateTime.Parse(i.Attributes["ows_Created"].Value);
   
string createdBy = i.Attributes["ows_Author"].Value; // 格式为userID;#userName
   DateTime modified = DateTime.Parse(i.Attributes["ows_Modified"].Value);
   
string modifiedBy = i.Attributes["ows_Editor"].Value; // 格式为userID;#userName
   EnumStatus status = (EnumStatus) Enum.Parse(typeof(EnumStatus), i.Attributes["ows_Status"].Value);
  
if (i.Attributes.GetNamedItem("ows_Machine")!=null//可能为空的字段要先作检查
        string machine = i.Attributes["ows_Machine"].Value;
     }

}


posted on 2007-10-17 14:35  愚公  阅读(415)  评论()    收藏  举报