PDA

View Full Version : سوال: جستجو در فایل xml و ریختن آیتم پیدا شده در listbox (کد)



samadblaj
جمعه 24 شهریور 1391, 22:15 عصر
سلام لطفا کمکم کنید میخوام توی این فایل پیوستی دنبال موضوعات مطالب بگردم و به لیست باکسم اضاف کنم :متفکر:
خیلی جستجو کردم به نتیجه مطلوبی نرسیدم غیر از این تا تاپیک ببینید (http://stackoverflow.com/questions/8123320/consume-rss-feed-xml-and-display-information)

لطفا نگاه عکس پیوستی قسمت مشخص شده کنید میخوام این فیلد ها رو به لیست باکس اضاف کنه :متفکر:

ehsan7007
جمعه 24 شهریور 1391, 22:28 عصر
اول بریزه تو دیتابیس ؟

Babak-Magic
جمعه 24 شهریور 1391, 22:29 عصر
درود ار این نمونه استفاده کن
XmlTextReader get = new XmlTextReader("Setting.Xml");
XmlNodeType Type;
while (get.Read())
{
Type = get.NodeType;
if (Type == XmlNodeType.Element)
{
if (get.Name == "UserName")
{
get.Read();
txtuser.Text = get.Value;
}
if (get.Name == "Password")
{
get.Read();
txtpass.Text = get.Value;
}
if (get.Name == "Server")
{
get.Read();
txtserver.Text = get.Value;
}
if (get.Name == "Subject")
{
get.Read();
txtsubject.Text = get.Value;
}
if (get.Name == "body")
{
get.Read();
txtbody.Text = get.Value;
}
}
}

samadblaj
جمعه 24 شهریور 1391, 22:32 عصر
نه اصلا نیاز نیست تگ های title که توی عکس مشخصه رو بریزه توی یه لیست به هر شکل میخواد باشه.
فقط باید توی فایل xml فیلد title جست و جو کنه اونو بریزه توی لیست باکس.
فایل ضمیمه فایل xml ـم هستش.

samadblaj
جمعه 24 شهریور 1391, 22:33 عصر
درود ار این نمونه استفاده کن
جناب بابک میشه خودتون یه تست به فایل پیوستی پست یک بزنید ببینید جواب میده ! چون من با xml کار نکرده ام زیاد اینم به نظرم یه فایل خاصه...

Babak-Magic
جمعه 24 شهریور 1391, 22:43 عصر
خدمت شما دوسته عزیز

samadblaj
جمعه 24 شهریور 1391, 22:47 عصر
خدمت شما دوسته عزیز
بابا دمت گرم خیلی حال دادید! ، راستی ببخشید میشه برای لینک ها هم به همین روشی که شما استفاده کردید استفاده کنم؟

Babak-Magic
جمعه 24 شهریور 1391, 22:49 عصر
خواهش میکنم عزیزم بله میشه از همین روش استفاده کرد

samadblaj
جمعه 24 شهریور 1391, 23:00 عصر
ممنونم بابک جان واقعا سرعت عملت هم عالی بود.
از تو هم متشکرم احسان جان زحمت کشیدید

danialafshari
یک شنبه 11 فروردین 1392, 00:13 صبح
خدمت شما دوسته عزیز
سلام
من با یک روش آسون تر کار می کردم ولی محدوده و زیاد باش بلد نیستم مثل جستجو
با تشکر
اگر لطف کنی اعمال Add - Delete - Update - Search رو هم پیاده سازی کنید خیلی خوب میشه

mah.t3230
پنج شنبه 15 فروردین 1392, 15:41 عصر
درود ار این نمونه استفاده کن


سلام..
ایا این کد رو برای " جستجو کلمه یا عبارتی در متن XML و بازیابی ان" میشه بکار برد؟
اگه نه ، میشه تو این زمینه بهم کمک کنید!

tooraj_azizi_1035
پنج شنبه 15 فروردین 1392, 18:37 عصر
IEnumerable<XElement> partNos =
from item in purchaseOrder.Descendants("Item")
where (int) item.Element("Quantity") *
(decimal) item.Element("USPrice") > 100
orderby (string)item.Element("PartNumber")
select item;

oracle
چهارشنبه 15 خرداد 1392, 21:30 عصر
ضمن عرض احترام.
من اگر بخواهم این فایل رو بخونم و 3 ایتم R , G, B را استخراج کنم که در یک دیتا بیس ذخیره بشه تا عملیات سورتینگ روش انجام بدم چه کاری باید بکنم؟

<?xml version="1.0"?>
-<palette name="test color.xml" guid="60440804-5483-438c-80c4-5a97ad905eec">-<colors>-<page><color name="R255 G255 B255" tints="1,1,1" cs="RGB"/><color name="R0 G0 B0" tints="0,0,0" cs="RGB"/><color name="R53 G4 B3" tints="0.207843,0.0156863,0.0117647" cs="RGB"/><color name="R81 G6 B0" tints="0.317647,0.0235294,0" cs="RGB"/><color name="R85 G29 B24" tints="0.333333,0.113725,0.0941176" cs="RGB"/><color name="R110 G14 B1" tints="0.431373,0.054902,0.00392157" cs="RGB"/><color name="R129 G35 B20" tints="0.505882,0.137255,0.0784314" cs="RGB"/><color name="R153 G60 B43" tints="0.6,0.235294,0.168627" cs="RGB"/><color name="R176 G93 B74" tints="0.690196,0.364706,0.290196" cs="RGB"/><color name="R37 G20 B16" tints="0.145098,0.0784314,0.0627451" cs="RGB"/><color name="R155 G70 B49" tints="0.607843,0.27451,0.192157" cs="RGB"/><color name="R94 G19 B0" tints="0.368627,0.0745098,0" cs="RGB"/><color name="R138 G36 B10" tints="0.541176,0.141176,0.0392157" cs="RGB"/><color name="R128 G50 B28" tints="0.501961,0.196078,0.109804" cs="RGB"/><color name="R20 G5 B1" tints="0.0784314,0.0196078,0.00392157" cs="RGB"/><color name="R175 G100 B78" tints="0.686275,0.392157,0.305882" cs="RGB"/><color name="R191 G123 B102" tints="0.74902,0.482353,0.4" cs="RGB"/><color name="R78 G43 B29" tints="0.305882,0.168627,0.113725" cs="RGB"/><color name="R129 G119 B115" tints="0.505882,0.466667,0.45098" cs="RGB"/><color name="R98 G63 B48" tints="0.384314,0.247059,0.188235" cs="RGB"/><color name="R203 G154 B131" tints="0.796078,0.603922,0.513725" cs="RGB"/><color name="R76 G47 B33" tints="0.298039,0.184314,0.129412" cs="RGB"/><color name="R233 G231 B230" tints="0.913725,0.905882,0.901961" cs="RGB"/><color name="R50 G24 B10" tints="0.196078,0.0941176,0.0392157" cs="RGB"/><color name="R96 G56 B34" tints="0.376471,0.219608,0.133333" cs="RGB"/><color name="R79 G46 B27" tints="0.309804,0.180392,0.105882" cs="RGB"/><color name="R116 G72 B46" tints="0.454902,0.282353,0.180392" cs="RGB"/><color name="R125 G81 B55" tints="0.490196,0.317647,0.215686" cs="RGB"/><color name="R62 G31 B13" tints="0.243137,0.121569,0.0509804" cs="RGB"/><color name="R98 G54 B27" tints="0.384314,0.211765,0.105882" cs="RGB"/><color name="R103 G68 B46" tints="0.403922,0.266667,0.180392" cs="RGB"/><color name="R131 G92 B68" tints="0.513725,0.360784,0.266667" cs="RGB"/><color name="R103 G72 B51" tints="0.403922,0.282353,0.2" cs="RGB"/><color name="R152 G117 B93" tints="0.596078,0.458824,0.364706" cs="RGB"/><color name="R134 G87 B56" tints="0.52549,0.341176,0.219608" cs="RGB"/><color name="R89 G76 B67" tints="0.34902,0.298039,0.262745" cs="RGB"/><color name="R141 G95 B63" tints="0.552941,0.372549,0.247059" cs="RGB"/><color name="R115 G74 B44" tints="0.45098,0.290196,0.172549" cs="RGB"/><color name="R134 G89 B54" tints="0.52549,0.34902,0.211765" cs="RGB"/><color name="R125 G94 B69" tints="0.490196,0.368627,0.270588" cs="RGB"/><color name="R206 G196 B187" tints="0.807843,0.768627,0.733333" cs="RGB"/><color name="R151 G108 B71" tints="0.592157,0.423529,0.278431" cs="RGB"/><color name="R151 G108 B70" tints="0.592157,0.423529,0.27451" cs="RGB"/><color name="R222 G199 B177" tints="0.870588,0.780392,0.694118" cs="RGB"/><color name="R160 G122 B86" tints="0.627451,0.478431,0.337255" cs="RGB"/><color name="R184 G157 B131" tints="0.721569,0.615686,0.513725" cs="RGB"/><color name="R144 G116 B90" tints="0.564706,0.454902,0.352941" cs="RGB"/><color name="R200 G179 B160" tints="0.784314,0.701961,0.627451" cs="RGB"/><color name="R162 G123 B84" tints="0.635294,0.482353,0.329412" cs="RGB"/><color name="R175 G154 B131" tints="0.686275,0.603922,0.513725" cs="RGB"/><color name="R186 G161 B134" tints="0.729412,0.631373,0.52549" cs="RGB"/><color name="R205 G180 B152" tints="0.803922,0.705882,0.596078" cs="RGB"/><color name="R158 G135 B108" tints="0.619608,0.529412,0.423529" cs="RGB"/><color name="R212 G193 B171" tints="0.831373,0.756863,0.670588" cs="RGB"/><color name="R123 G109 B93" tints="0.482353,0.427451,0.364706" cs="RGB"/><color name="R164 G145 B123" tints="0.643137,0.568627,0.482353" cs="RGB"/><color name="R169 G138 B103" tints="0.662745,0.541176,0.403922" cs="RGB"/><color name="R193 G167 B136" tints="0.756863,0.654902,0.533333" cs="RGB"/><color name="R185 G157 B122" tints="0.72549,0.615686,0.478431" cs="RGB"/><color name="R181 G165 B146" tints="0.709804,0.647059,0.572549" cs="RGB"/><color name="R188 G175 B158" tints="0.737255,0.686275,0.619608" cs="RGB"/><color name="R168 G137 B97" tints="0.658824,0.537255,0.380392" cs="RGB"/><color name="R176 G147 B110" tints="0.690196,0.576471,0.431373" cs="RGB"/><color name="R161 G156 B149" tints="0.631373,0.611765,0.584314" cs="RGB"/><color name="R196 G185 B168" tints="0.768627,0.72549,0.658824" cs="RGB"/><color name="R205 G196 B178" tints="0.803922,0.768627,0.698039" cs="RGB"/><color name="R93 G84 B45" tints="0.364706,0.329412,0.176471" cs="RGB"/><color name="R231 G223 B181" tints="0.905882,0.87451,0.709804" cs="RGB"/><color name="R152 G141 B77" tints="0.596078,0.552941,0.301961" cs="RGB"/><color name="R127 G119 B65" tints="0.498039,0.466667,0.254902" cs="RGB"/><color name="R250 G245 B210" tints="0.980392,0.960784,0.823529" cs="RGB"/><color name="R216 G209 B157" tints="0.847059,0.819608,0.615686" cs="RGB"/><color name="R200 G193 B133" tints="0.784314,0.756863,0.521569" cs="RGB"/><color name="R183 G178 B113" tints="0.717647,0.698039,0.443137" cs="RGB"/><color name="R169 G165 B88" tints="0.662745,0.647059,0.345098" cs="RGB"/><color name="R87 G95 B52" tints="0.341176,0.372549,0.203922" cs="RGB"/><color name="R67 G76 B36" tints="0.262745,0.298039,0.141176" cs="RGB"/><color name="R60 G70 B30" tints="0.235294,0.27451,0.117647" cs="RGB"/><color name="R96 G108 B64" tints="0.376471,0.423529,0.25098" cs="RGB"/><color name="R114 G127 B84" tints="0.447059,0.498039,0.329412" cs="RGB"/><color name="R70 G87 B42" tints="0.27451,0.341176,0.164706" cs="RGB"/><color name="R125 G155 B96" tints="0.490196,0.607843,0.376471" cs="RGB"/><color name="R32 G55 B16" tints="0.12549,0.215686,0.0627451" cs="RGB"/><color name="R84 G128 B61" tints="0.329412,0.501961,0.239216" cs="RGB"/><color name="R95 G143 B71" tints="0.372549,0.560784,0.278431" cs="RGB"/><color name="R71 G119 B50" tints="0.278431,0.466667,0.196078" cs="RGB"/><color name="R58 G105 B43" tints="0.227451,0.411765,0.168627" cs="RGB"/><color name="R153 G179 B145" tints="0.6,0.701961,0.568627" cs="RGB"/><color name="R46 G86 B36" tints="0.180392,0.337255,0.141176" cs="RGB"/><color name="R37 G74 B29" tints="0.145098,0.290196,0.113725" cs="RGB"/><color name="R212 G219 B229" tints="0.831373,0.858824,0.898039" cs="RGB"/><color name="R78 G108 B153" tints="0.305882,0.423529,0.6" cs="RGB"/><color name="R102 G132 B177" tints="0.4,0.517647,0.694118" cs="RGB"/><color name="R42 G68 B111" tints="0.164706,0.266667,0.435294" cs="RGB"/><color name="R133 G160 B207" tints="0.521569,0.627451,0.811765" cs="RGB"/><color name="R195 G213 B245" tints="0.764706,0.835294,0.960784" cs="RGB"/><color name="R62 G86 B129" tints="0.243137,0.337255,0.505882" cs="RGB"/><color name="R23 G42 B81" tints="0.0901961,0.164706,0.317647" cs="RGB"/><color name="R190 G196 B209" tints="0.745098,0.768627,0.819608" cs="RGB"/><color name="R172 G193 B242" tints="0.67451,0.756863,0.94902" cs="RGB"/><color name="R165 G181 B218" tints="0.647059,0.709804,0.854902" cs="RGB"/><color name="R6 G16 B42" tints="0.0235294,0.0627451,0.164706" cs="RGB"/><color name="R174 G179 B193" tints="0.682353,0.701961,0.756863" cs="RGB"/><color name="R200 G203 B212" tints="0.784314,0.796078,0.831373" cs="RGB"/><color name="R177 G182 B198" tints="0.694118,0.713725,0.776471" cs="RGB"/><color name="R186 G191 B207" tints="0.729412,0.74902,0.811765" cs="RGB"/><color name="R152 G157 B174" tints="0.596078,0.615686,0.682353" cs="RGB"/><color name="R57 G62 B84" tints="0.223529,0.243137,0.329412" cs="RGB"/><color name="R129 G133 B151" tints="0.505882,0.521569,0.592157" cs="RGB"/><color name="R160 G163 B179" tints="0.627451,0.639216,0.701961" cs="RGB"/><color name="R176 G177 B188" tints="0.690196,0.694118,0.737255" cs="RGB"/><color name="R42 G41 B53" tints="0.164706,0.160784,0.207843" cs="RGB"/><color name="R99 G98 B108" tints="0.388235,0.384314,0.423529" cs="RGB"/><color name="R135 G132 B141" tints="0.529412,0.517647,0.552941" cs="RGB"/><color name="R69 G59 B59" tints="0.270588,0.231373,0.231373" cs="RGB"/></page></colors></palette>