问题描述
文件内容如下:<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEplistPUBLIC"-//AppleComputer//DTDPLIST1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plistversion="1.0"><dict><key>ProductID</key><string>IPHONE_1ND</string><key>CFBundleName</key><string>AlipayPortal</string><key>DTSDKName</key><string>iphoneos4.2</string><key>DTXcode</key><string>0325</string><key>UTImportedTypeDeclarations</key><array></array><key>Safepayversion</key><string>2.2.4</string><key>CFBundleDevelopmentRegion</key><string>zh_CN</string><key>CFBundleVersion</key><string>3.1</string><key>NSMainNibFile</key><string>MainWindow</string><key>CFBundleDocumentTypes</key><array></array><key>CFBundlePackageType</key><string>APPL</string><key>CFBundleIconFile</key><string>icon.png</string><key>UserAgent</key><string>ALIPAY_FOR_IOS</string><key>DTPlatformName</key><string>iphoneos</string><key>CFBundleSupportedPlatforms</key><array><string>iPhoneOS</string></array><key>CFBundleInfoDictionaryVersion</key><string>6.0</string><key>CFBundleExecutable</key><string>AlipayPortal</string><key>DTCompiler</key><string>com.apple.compilers.llvm.clang.1_0</string><key>UIDeviceFamily</key><array><integer>1</integer></array><key>CFBundleURLTypes</key><array><dict><key>CFBundleURLName</key><string></string><key>CFBundleURLSchemes</key><array><string>alipay</string></array></dict></array><key>CFBundleIdentifier</key><string>com.alipay.iphoneclient</string><key>CFBundleResourceSpecification</key><string>ResourceRules.plist</string><key>CFBundleSignature</key><string>????</string><key>UTExportedTypeDeclarations</key><array></array><key>LSRequiresIPhoneOS</key><true/><key>CFBundleIconFiles</key><array><string>icon.png</string><string>icon@2x.png</string></array><key>CFBundleDisplayName</key><string>支付宝</string><key>DTXcodeBuild</key><string>10M2423</string><key>DTPlatformVersion</key><string>4.2Seed2</string><key>MinimumOSVersion</key><string>3.0</string><key>DTPlatformBuild</key><string>8C134</string><key>ProductVersion</key><string>3.0.1.1025</string></dict></plist>要求一、用C#查询CFBundleDisplayName的值,此例值为“支付宝”要求二:用C#查询CFBundleIconFiles的值,此例值为icon.png、icon@2x.png
解决方案
解决方案二:
楼主看看LINQtoXML方面的内容,搜索下网上很多的
解决方案三:
我也知道应该是用LINQtoXML,也搜索了,无奈还是未能解决,大大能否给出代码吗?
解决方案四:
你这个XML有问题<key>CFBundleDisplayName</key><string>支付宝</string><key>DTXcodeBuild</key><string>10M2423</string><key>DTPlatformVersion</key><string>4.2Seed2</string><key>MinimumOSVersion</key><string>3.0</string><key>DTPlatformBuild</key><string>8C134</string><key>ProductVersion</key><string>3.0.1.1025</string>你问的是根据支付宝找出对应的key值但是这里string和key值同为兄弟关系的都是一样的,没法找啊