|
OK, so the number im reading in was stored based on seconds since 1970 but the Dot Net framework's times are based on 100 nanoseconds since 0001??
Kev
|
|
|
|
|
Is it possible to lower the priority of a program compiled in C# at compile time. I have a program that encodes wav files to wma files as the wav files are generated. It works well, but, it sucks up 100% of the CPU when it runs. Microsoft says the the program will give the processor up automatically as other processes need it, but, I would rather have just run slower anyway. The encoding does not need to be don in real time.
Thanks
|
|
|
|
|
Set the priority for the the current thread as follows.
System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.BelowNormal;
The fields in the ThreadPriority enum are:
<br />
AboveNormal<br />
BelowNormal<br />
Highest<br />
Lowest<br />
Normal<br />
|
|
|
|
|
Thank you very much.
Does that go inside the thread that I spun off or inside the function that calls the thread.
|
|
|
|
|
It doesn't matter where it goes. Every thread exposes the Priority property. It can go in the thread you whose priority you want to lower. It can also be used by another thread (i.e. a parent thread). All you need is a reference to a thread and you can set its priority. If you use the CurrentThread line of code I posted then it needs to be available to (inside) the code that the given thread is running.
|
|
|
|
|
bk5151 wrote:
Is it possible to lower the priority of a program compiled in C# at compile time
I'm not sure what you mean by changing the priority at COMPILE time ?
So I'm going to the assumption you want to change the priority during runtime.
Is your program, multi-threaded ? If so I would guess you could just change the priority of the thread in which your doing your conversion.
|
|
|
|
|
In VC++ 6, I thought there was a way to accomplish this at compile time in the Project Settings menu by optimizing the code. I could have been wrong though. However, at run time will do just fine. Accoustic, showed me a function to call to set this level. I am just not sure if this goes inside the thread that I called or if it goes inside the function that spins the tread off.
|
|
|
|
|
It depends on if your prgram is mult-threaded.
If it is not MT, add Accoustic's code to your program's constructor.
If it is MT, then just change the priority of the thread doing the conversion.
|
|
|
|
|
Thanks guys. I am going to try this out.
|
|
|
|
|
Hello All,
I hope this is a question with a simple solution that I've overlooked. I am loading an image reference (URL) into a ASP.NET image control when the page loads. The problem is that I'm loading a reference from an MLS system and the image link is occasionally broken.
Is there a simple way to reference a property of the image control to tell if the image sucessfully loaded? If so, I can't find it. Currently I'm using code to detect if the URL is valid before setting the property of the image control. This requires a round trip to the image host server to detect a 404 response. It works, but is SLOW when there are more than a dozen pictures. I hate slow...
Any help is appreciated.
Cheers,
Will
|
|
|
|
|
First, this really belongs on the ASP.Net board, but I'll take a whack at it anyway...
I don't know your reasons for caring why/when an image doesn't load, so I'm not sure how useful I can be, but the image loads on the client. You could add attributes to the Image (or HtmlImage) control to execute javascript on a load failure (OnError I think), but that would only work in IE.
In general, could you not just check the image dimensions (still on the client side)? I think the width and height would be zero if the url was not available, and that should work on almost any browser.
Hope this helps.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
can we parse eml file... as in is there any way apart from taking the data as text and getting data out of it by Regular Expression...
|
|
|
|
|
Hi, all.
I'm a bit of a newbie to C# and .NET. I want to create an on-screen keyboard for a touchscreen. They keyboard itself is easy enough, but I'm not sure how to "stuff" the keystrokes into the keyboard buffer. There's probably a better way than "stuffing" to begin with...
I want to be able to pop up a keyboard, and have keystrokes entered into the control that had focus before the keyboard appeared.
Any suggestions, or pointers to useful articles would be appreciated.
Thanks.
Len
|
|
|
|
|
Almost every tochscreen ive ever seen has come with onscreen keyboard software bundled in with them - is there some reason why that or a 3rd party app will not do (ie, is this a leaning excercise?)
|
|
|
|
|
That it a good point. I haven't received the monitor yet, and the product info doesn't say if it comes with a utility to do this. However, having said that, I'm using this in a machine automation application, and would still like to be able to customize the user interface... probably not possible with a third party tool.
So, if anyone knows how to do this, I'm still very interested.
Thanks.
Len
|
|
|
|
|
Can anyone please help me to use Highlighter.net.
my requirement is as follows:
when i click on the filename which is in a listbox, the file content should be displayed in a textbox, and the search words should be highlighted.
|
|
|
|
|
Hi
I got following function. When I debug the code '"+Name+"' is
Name="System.Data.DataRowView".
Does anybody knows why?
private void menuItem1_Select(object sender, System.EventArgs e)
{
string Name = this.listBox1.SelectedItem.ToString();
OleDbConnection conn = new OleDbConnection(connString);
OleDbCommand dbCommand = new OleDbCommand("SELECT Beschreibung FROM tbl_T5 WHERE (Rechner = '"+Name+"')", conn);
conn.Open();
OleDbDataReader dbReader;
dbReader = dbCommand.ExecuteReader();
dbReader.Read();
if (dbReader.HasRows)
{
this.menuItem2.Text = dbReader["Beschreibung"].ToString();
}
dbReader.Close();
conn.Close();
}
|
|
|
|
|
That's quite easy:
Name is set at exactly one location, so the value you see is the result of this.listBox1.SelectedItem.ToString(); .
That means the selected item in your listBox1 is a DataRowView . DataRowView doesn't have an overloaded ToString method, so you simply get the type name.
But what's the question? Obviously you expect Name to be something else. Could it be that you don't want one of listBox1's items?
Without further info we can only guess...
mav
|
|
|
|
|
Try replace this.listBox1.SelectedItem.ToString(); by this.listBox1.SelectedItem.Text;
|
|
|
|
|
got it..
DataRowView dv =(DataRowView)this.listBox1.SelectedItem;
this.menuItem2.Text = dv["Beschreibung"].ToString();
Thank you
|
|
|
|
|
Hi,
Can I use c#.net to automate Outlook Express ?
Btw, are there any C# based MAPI for communicating with Outlook Express ?
Many Thanks
|
|
|
|
|
|
Thanks for ur reply.
So it means I need to access outlook express with MAPI ?
And do you know any c# based MAPI component or code reference for MAPI with outlook express ?
|
|
|
|
|
Automation does not work with Express. MS wants you to pay for Outlook to do automation.
|
|
|
|
|
Hi Geeks,
I am quite new to creating skinnable applications.
Could anyone tell me how to approach this work in C# .Net.
I checked out some links but most of them are commercial.
Basically i want to add a new feature to my application,
so that custom skins can be used as required.
Thanks,
know THE WAY,
-SimSan
|
|
|
|