ערכתי לאחרונה בתאריך 25.01.12 בשעה 00:56 בברכה, liran
או כל TEXT שקיים בC#יש לי את הקוד הבא:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using System.Xml.XPath;namespace MsnHistoryViewer { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { //Opening an XML file OpenFileDialog nf = new OpenFileDialog(); nf.Filter = "XML| *.xml"; if (nf.ShowDialog() == DialogResult.OK) { XmlDocument xdoc = new XmlDocument(); xdoc.Load(nf.FileName); //parsing the nodes e.g XML tags foreach (XmlNode node in xdoc.SelectNodes("Log/Message")) { //Parsering the XML, for MSN usernames and for the actual text inside the chat richTextBox1.Text += node.SelectSingleNode("From/User").Attributes.Value + Environment.NewLine; richTextBox1.Text += Environment.NewLine; richTextBox1.Text += node.SelectSingleNode("Text").InnerText + Environment.NewLine; } } } } }
|
הקוד
richTextBox1.Text += node.SelectSingleNode("From/User").Attributes.Value + Environment.NewLine;
|
הקוד מציג משהו ספציפי, ואת הטקסט הזה אני רוצה לשנות, כאילו את הצבע וגם הדגשה, אבל אין לי מושג איך אני עושה את זה
תודה
