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

推荐订阅源

P
Palo Alto Networks Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
S
Securelist
酷 壳 – CoolShell
酷 壳 – CoolShell
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cyberwarzone
Cyberwarzone
Apple Machine Learning Research
Apple Machine Learning Research
S
SegmentFault 最新的问题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
GbyAI
GbyAI
Security Latest
Security Latest
Last Week in AI
Last Week in AI
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
C
Cisco Blogs
博客园 - 【当耐特】
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
B
Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
The Last Watchdog
The Last Watchdog
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志
Project Zero
Project Zero
WordPress大学
WordPress大学
L
LINUX DO - 最新话题
F
Fortinet All Blogs
L
LINUX DO - 热门话题
PCI Perspectives
PCI Perspectives
Simon Willison's Weblog
Simon Willison's Weblog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MongoDB | Blog
MongoDB | Blog
Latest news
Latest news
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
The Hacker News
The Hacker News
爱范儿
爱范儿
O
OpenAI News
J
Java Code Geeks
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 愚公

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)  评论()    收藏  举报