|
Reading the event logs shouldn't be that intensive. I suspect the bottleneck lies around x.addEvent.
|
|
|
|
|
basically i used this code in window service which run on system get the Information of then Event and then send it to the server by web service just for maintaining log for my own purpose. but when i am calling the code that i write it use 60 to 70% of CPU for a min or so. and some time crash the System also.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
How long does it run for / how often do you run it? Efficient code should take 100% CPU, otherwise you are just making your CPU wait for other (in your case hard-disks) components.
If this is taking too much CPU, then you need to run it at a low priority.
|
|
|
|
|
Hello Mark
basically i used this code in window service which run on system get the Information of then Event and then send it to the server by web service just for maintaining log for my own purpose. but when i am calling the code that i write it use 60 to 70% of CPU for a min or so. and some time crash the System also.
WANTED wasim khan(Killed 50 Innocent Buggs, Distroyed 200 Exception, make 5 Project Hostage) any Compnay Hire him will pay 30,000. Best place where u can get him is Sorcim Technologies Murre Road RWP
|
|
|
|
|
i want to create something like solution explorer or toolbox in visual studio .net that can auto hide and can be closed. I want to create in visual c#.net 2008.
|
|
|
|
|
You want what's called "docking". Google "DockPanel suite".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
In the following method, the 'startPos' variable always contains -1 when searching for a string that is known to exist within the RichTextBox.
private string GetHeadingInnerHtml()
{
int startPos = myRich.Find("<head>", 0, RichTextBoxFinds.None);
int endPos = 0;
if (startPos >= 0)
{
endPos = myRich.Find("</head>", startPos + 6, RichTextBoxFinds.None);
myRich.SelectionStart = startPos;
myRich.SelectionLength = ( endPos - startPos );
return myRich.SelectedText;
}
return string.Empty;
}
Any ideas why?
Thanks.
|
|
|
|
|
What's your source text? The Find method which accepts string will not find text, if it is more than on one line.
Regards,
Lev
|
|
|
|
|
If it returns -1, it ain't there.
Are you sure there's no Text property in the myRich object?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I set a watch for the value of myRich.Text property. Then I noticed that an earlier called method cutoff part of the <head> element's starting tag so naturally the Find method did not find it.
Thanks,
Mark
|
|
|
|
|
This worked OK for me. I put the following text into a RTB and it found the details with no problem.
<html>
<head>
<some tesxttlkajsdlfj asdf>
</head>
</html>
If you debug your application, what does myRich.Text contain when you step into this method?
|
|
|
|
|
Hi,
I want my program to close a MessageBox automatically after x seconds, whether the user answers to MessageBox or not.
How is that?
thanks
|
|
|
|
|
Write your own messagebox (just create a dialogform)
Put a timer on it and close the form after x seconds has past.
There might be a better way but this is how I would do it.
|
|
|
|
|
so how can i assign my icon to that as easy as MessageBoxIcon.Information or MessageBoxIcon.Error ... does?
should i use my own PictureBox for it and make all fundamentals from the begining, or is there any other way that i use right that enum (MessageBoxIcon) instead?
|
|
|
|
|
AFAIK, you have to create your own form and use some methods to draw the icon on it. This form can return a DialogResult as message box does.
|
|
|
|
|
If you decide to create it yourself I recommend doing it from scratch.
But the other reply has a link to a nice article that does exactly what you want.
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Hi,
please send me code sample for uploading a video in c# .net
|
|
|
|
|
This is NOT rentacoder.com
Nobody is just going to give you code.
You need to do your own research, write your own code, try to get it working and then when/if you get stuck on a certain piece of code you can post it here (with the error message if any) and people will try to help.
That goes for both your posts.
|
|
|
|
|
Manilipa wrote: please send me code sample for uploading a video in c# .net
Sure.
public interface IUpload
{
void UploadItem(Stream value);
}
public class UploadVideo : IUpload
{
public void UploadItem(Stream value)
{
SaveStream(value);
}
private void SaveStream(Stream value)
{
}
} There - all you have to do is provide some code to write the stream to whatever medium you're saving it to, oh and a mechanism to get the data into your UploadVideo class, but that's trivial implementation detail. I'm sure a rocket scientist like yourself won't have any problem with this.
|
|
|
|
|
Maybe you should read the first article and adapter yourself to ask question properly.
LuckyBoy
|
|
|
|
|
Hi,
please send me code sample of email functionality with attachment in c#.net
|
|
|
|
|
Is Google on holiday today?
only two letters away from being an asset
|
|
|
|
|
|