- 117 名前:みんなどっちの書き方が好き? mailto:sage [2009/01/23(金) 15:35:42 ]
- private static bool TryGetAttributeValue(HtmlNode node, string xpath, string attrString, out string value){
value = default(string); if(node == null) return false; HtmlNode aNode = node.SelectSingleNode(xpath); if(aNode == null) return false; HtmlAttribute attribute = aNode.Attributes[attrString]; if(attribute == null) return false; value = attribute.Value; return true; } private static bool TryGetAttributeValue(HtmlNode node, string xpath, string attrString, out string value){ value = default(string); if(node == null) return false; HtmlNode aNode = node.SelectSingleNode(xpath); if(aNode != null){ HtmlAttribute attribute = aNode.Attributes[attrString]; if(attribute != null){ value = attribute.Value; return true; } } return false; }
|

|