|
Use regular expressions to find a match
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
How on earth does that help the OP?
He is not looking for a match, he wants to convert the string to a DateTime structure.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: Here while reading the file how can I know that a particular line is a time stamp
Sometime, its better to read the complete message and not giving a conclusion based on the last line.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
string s = "Tue May 26 17:48:53 2009";
DateTime d = DateTime.ParseExact(s, "ddd MMM dd HH:mm:ss yyyy", new CultureInfo("en-US"), DateTimeStyles.NoCurrentDateDefault);
|
|
|
|
|
Like it! ParseExact - another one to commit to memory.
Regards,
Rob Philpott.
|
|
|
|
|
Wow. What noone caught onto here is that your code sample is written in C, not C#. Everything you've been told will not apply to your code.
You're in the wrong forum. You want the C/C++/MFC forum..
|
|
|
|
|
He said also that:
Now I want to read this file in a C# program
|
|
|
|
|
Whoops.
|
|
|
|
|
Whoa, slow there with the trigger, cowboy.
Cheers,
Vikram. Current activities:
Films: Philadelphia
TV series: Friends, season 4
Books: Six Thinking Hats, by Edward de Bono. Carpe Diem.
|
|
|
|
|
Vikram A Punathambekar wrote: cowboy
No, you've got me confused with another member of my team. That's his nickname, not mine.
Mine is more like, Conan the Destroyer.
|
|
|
|
|
I am a bit new to graphics in c#. Is there a way maybe to create a graphics object like a circle or square that it will look like it is 2d and then whenever a user click anywhere in the image object it must maybe give something like a messagebox and say it was clicked.
Graphics dc = this.CreateGraphics();
this.Show();
Pen bluePen = new Pen(Color.Blue, 3);
dc.DrawRectangle(bluePen, 0, 0, 50, 50);
Pen redPen = new Pen(Color.Red, 2);
dc.DrawEllipse(redPen, 0, 50, 80, 60);
This is what i tried but do not know how to make it look 3d or clickable
any help will be apreciated
Thank you
|
|
|
|
|
A few pointers as follows:
1) Rather than calling .CreateGraphics() handle the OnPaint event which gives you access to the Graphics object of the current control. This saves you having to determine every time your form is invalidated as the OnPaint event is raised at that time.
2) On a computer screen (which is inherantly flat) it is absolutely impossible to make an image 3 dimentional. The best you can do is fool the users eyes (and therefore brain) into thinking that they are looking at a 3 dimensional image. To do this you use perspective, shading etc.
2d box:
---
| |
---
3d box:
___
/ /|
--- |
| |/
---
3) To make things clickable you could either a) Inherit your shape from the Control class whereby it will then receive click events or b) Handle the click event of the form and using the mouse location (provided by the event) determine if the click is within the bounds of your shape.
|
|
|
|
|
|
i have written a database application in c#, the application use another c# dll to connect with the database.
I am getting some exception inside the c# dll( i have not include exception handling inside the dll), but those exceptions are not being caught from the application.
for example
try
{
DatabaseManager db = new DatabaseManager();
db.Execute();
}
catch ( Exception ex )
{
}
here the DB.Execute() is crashing inside the dll but not capturing in application.What could be the reason?
My small attempt...
|
|
|
|
|
|
stancrm wrote: from my experience, in that row, the dll create a new thread, and the new thread throw an exception.
There is no new thread created in that code.
|
|
|
|
|
|
|
You should review of Execute method code.
A DATAPOST COMPUTER CENTRE
(K.V Prajapati)
|
|
|
|
|
Hi here the Execute method is crashing......
Here my problem is that my application is not able to catch that exception.( those exceptions occurs inside the dll)
My small attempt...
|
|
|
|
|
Because you've swallowed the exception (and logged it according to your comments) rather than rethrowing it.
try
{
}
catch(Exception ex)
{
throw;
}
now the calling application will receive the exception.
|
|
|
|
|
There may be some mistake in my question .let me explain it once more....
<pre> try
{
// This function is inside the DLL
Function();
}
catch ( Exception ex )
{
// Log exception
}
//Inside the DLL
public void Function()
{
// something which is crashing.......
}
what i am saying is i am not getting the exception which is occuring inside the dll....
My small attempt...
|
|
|
|
|
If you are not getting the exception, how do you know Function is crashing?
|
|
|
|
|
Please come to my question............. ]if i put try catch inside the dll , that will catch the exception
My small attempt...
|
|
|
|
|