Found my own solution ... in case anybody else wants to know: activitytime = "01/Apr/2003:11:01:02 +1000"; DateTime dt = DateTime.ParseExact(activitytime, "dd/MMM/yyyy:HH:mm:ss zzz", new System.Globalization.DateTimeFormatInfo());
James McCutcheon
Posts
-
DateFormat -
DateFormatI want to read a date string from a log file it is in this format ... 17/Apr/2003:06:40:39 +1000 I would like to parse this then display it as the local time format. I am lost in the world of Globalization James McCutcheon
-
Another XPath QuestionSay i had this ... data first second and I want this ... data first What would be the xpath statement ? something to do with C[1], but I am stumped after that - james
-
Application.StartupPath.ToString();Yes it will ... - James
-
Serial PortCheck this article out ... http://www.devhood.com/tutorials/tutorial\_details.aspx?tutorial\_id=320 though the author's picture is a bit of a worry :) - James
-
RichTextBoxTry this .... //load the image System.Drawing.Image myimage = System.Drawing.Image.FromFile("Sample.jpg"); //create a picture box PictureBox mypb = new PictureBox(); mypb.Image = myimage; //adjust the size mypb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.richTextBox1.Controls.Add(mypb);
-
BringToFront changes indexJust thought I would make people aware of something I noticed, ok it took me a while to work out why and I had to tell somebody ... I just noticed that if you use the method BringToFront for a label control the index for the control moves. - James
-
getting location of schema usedI load in an xml document and validate it ... ok thats the easy part XmlDocument doc = new XmlDocument(); XmlTextReader tr = new XmlTextReader("Sample.xml"); XmlValidatingReader reader = new XmlValidatingReader(tr); doc.Load(reader); there might be several schemas that are used to validate, their location is specified via the xml schemalocation attribute. Now if I want a table of those locations i presently read and parse the location attribute and manually match up the namespace prefix with the location file via the namespace URI. So i can go and physically read in the validating schemas. XmlNode myNode = oc.SelectSingleNode("//instance:group",xmlnsmgr); XmlNodeReader myreader = new XmlNodeReader(myNode); myreader.Read(); myreader.MoveToAttribute("schemaLocation",this.xml_schema_ns); String[] schemalist = myreader.Value.Split(new char[] {' '}); The must be a simplier way I dont know about, please if anybody knows can the enlighten me. Thanks in Advance James