|
Christian Graus wrote: Yes, I don't think there's ever any guarentee as to when a static constructor will be called,
Actually, there is, if the class is not marked with the beforefieldinit flag. This[^] discusses the various possibilities with and without beforefieldinit.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
NEVER have exceptions thrown from a static constructor.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
Hi, I have Rational Rose XDE for Visual Studio and I want to do a reverse engeneering from an existing C# project. Can you tell me the steps to do that? Thank you!
|
|
|
|
|
Hello, I have made an application and I know how to add a progress bar to it that can run based on timers, however if my code is within a large loop (such as an algorithm) the progress bar freezes (even on progress bars created by other people). Is there a way to make it so a progress bar will progress even inside of a large loop. This is mostly a "gold-plating" feature, however any help to accomplish it would be helpful. Thanks!
Mike - I love to program!
|
|
|
|
|
I think you have to make a second thread. In this Thread you do your large loop and call (with delagate) a method that performes a step of the toolbar.
mfg
edvo
|
|
|
|
|
You could also just call Application.DoEvents() periodically inside your loop, which is a lot simpler than using multiple threads. Something roughly like this (there are lots of variations you could do on the same basic idea):
int onePercent = loopCount / 100;
for( int i = 0; i < loopCount; i++ )
{
DoLengthyCalculations();
if( i != 0 && i % onePercent == 0 )
{
progressBar.Value = i / onePercent;
Application.DoEvents();
}
}
Matt Gerrans
-- modified at 14:51 Sunday 23rd October, 2005
|
|
|
|
|
I am new to .NET and would realy apreciated if someone makes time to give me some hints on using BitArray (I am making a compresion program and I need some clues for serialization). I am sorry if I sound to newbie
.NET rocks&rulz
-- modified at 12:34 Sunday 23rd October, 2005
|
|
|
|
|
Look at BitVector32 instead.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
I would like to know if anyone shall be interested by a 100% C# class for reading/writing ID3V1 and read-only ID3V2 (working on the writing part right now).
I just would like to know if anyone would be interested to read an article about that. My job is nearly done on this class and I would put it on Code Project with a sample of an "automatic mp3 renamer".
Anyone's comment ?
If someone says "Die mortal!", don't stay to see if he isn't.
|
|
|
|
|
That sounds handy. I'm not very familiar with this stuff. Would it allow you to do something like rename mp3s so that they have their correct album order instead of being alphabetical?
Matt Gerrans
|
|
|
|
|
An ID3 is only a tag that is placed at the beginning or the end of a file and that allow to identify the Artist, song, track, album or more of a mp3.
Let's say that you have a song filename like this : "05 - Nothing Else Matter.mp3"
Unless you know that song... you don't know which artist it is. If you are a ordered music maniac like me... you must hate having files like that.
My class will allow you to read those tag. The tag will probably return "Metallica" and "Nothing Else Matters"
So the only thing you would need to do, build a software that use this class to do a mass renamer.
This will probably be my demo project.
That will rename all song selected from "05 - Nothing Else Matters.mp3" to "Metallica - Nothing Else Matters.mp3" or to any other template that could be configured (album, track, year... etc...)
Any body would like to comment ?
If someone says "Die mortal!", don't stay to see if he isn't.
|
|
|
|
|
I can only say that that would be a very cool article!
(And i need such a utility too... )
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
If a client try to connect a web server by HTTP procotol, what is the response of the server?
Thanks!
|
|
|
|
|
Depends on the request that the client made. You might want to read this[^] to understand the various requests and responses possible.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Dear All,
Please Help
Iam new to developing bilingual applications,now iam trying to develop a windows bilingual application English And Telugu.Iam facing a big problem with digits and date, I want to display the digits in native language by using culture info,but nothing will happen!if I change the setting in control panel digits change in native lang.How can i do this with out changing setting from control Panel.
|
|
|
|
|
Hi,
I'm currently downloading whole e-mails from a POP3 mail server. To do this procedure I'm using commands found in:
http://pages.prodigy.net/michael_santovec/pop3telnet.htm
Is there a way to extract ONLY the e-mail body from a whole mail using Regular Expressions or another method using C#?
Thanks.
|
|
|
|
|
hi,
i am developing a multimedia web site using asp.net and C#. i need to play a song on the web without downloading or buffering it in the client side.it will be real time streaming and playing. there will be some buttons like "play", "Next" and a progress bar below the song list with real time interactivity.
can any body help me in this regard giving detail guideline, links and sorce code if possible. i will be very greatful to u.
Thanx
Shafiq
|
|
|
|
|
Hello.
I made a class that inherits from Form and then when a user presses a button several Labels will be added. I also want to draw some lines and stuff to be included with the labels. I want to save it as filename.bmp on C drive, open and print out. How do I go about doing that?
I tried the following but to no avail:
Bitmap bm = new Bitmap("picslabel.bmp");
bm.Save(@"C:\picslabel.bmp", ImageFormat.Bmp);
I don´t get any error messages when I compile but the computer does not write what I created on C drive.
Is there some way I can accomplish this?
Thanks,
F
rfger
|
|
|
|
|
What exactly do you want to do? Save the form as a bmp?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for helping me.
My idea was to let the program create some labels when a user presses a button, draw some shapes and then save the labels and what was drawn in a document that can be opened in Paint (.bmp). After the user presses the button he/she can close the program and open a file (bmp) on C drive created by the program and print out the results.
I have been unable to make this happen
Regards,
Friðjón
F
|
|
|
|
|
So essentially you want a screenshot of the application? I'm afraid you can't do that using just C#, you'd have to write some MC++ code for it. This[^] might help you get started.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
if you only want the contents of the program to be displayed, then it is possible using only C#.. you should try making a compromise and declaring the labels as picture boxes.. anyway i don't understand why you don't create a print function right inside the program.. ex File>>Print toolbar.. it would be much easier and you could forget about the bitmap part because the Form.Print() function prints everything currently displayed in the program...
Ravenash
|
|
|
|
|
The code below works for me.
Bitmap bmp = new Bitmap(w,h,PixelFormat.Format24bppRgb);<br />
float res = 300f;
bmp.SetResolution(res,res);<br />
bmp.MakeTransparent(Color.White);<br />
Graphics G = Graphics.FromImage(bmp);<br />
G.PageUnit = GraphicsUnit.Pixel;<br />
G.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;<br />
G.CompositingQuality = CompositingQuality.HighQuality;<br />
G.CompositingMode = CompositingMode.SourceCopy;<br />
G.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit;<br />
G.InterpolationMode = InterpolationMode.High;<br />
G.Clear(Color.White);<br />
G.DrawRectangle(new Pen(Color.Black,2),0,0,w-2,h-2);<br />
....<br />
...<br />
G.Dispose();<br />
bmp.Save(imagefilePath,ImageFormat.Bmp);<br />
bmp.Dispose();
Note: the trick here is to create the bitmap in memory first, using PixelFormat.Format24bppRgb,
then create the graphics surface from it using Graphics.FromImage(). Then anything drawn on the graphics will also be drawn on the bitmap. When done, dispose the graphics and save the bitmap to a file using Image.Save(), then dispose the bitmap.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
-- modified at 12:09 Sunday 23rd October, 2005
|
|
|
|
|
Thanks for the help. I tried part of your code and it solves my problem. However, I still can´t get my program to write the labels and lines I want it to write to the .bmp file that the program makes. At the moment all it does is to make a blank .bmp file.
Thanks,
FJ
|
|
|
|
|
Thanks for the help. I tried part of your code and it solves my problem. However, I still can´t get my program to write the labels and lines I want it to write to the .bmp file that the program makes. At the moment all it does is to make a blank .bmp file. How do fix that?
Thanks,
FJ
|
|
|
|