|
Not really a C# question but ok, a quick search Here[^] brought up some promising results, but google isn't your friend.
1[^]
2[^]
3[^]
4[^]
Just to name a few from googles first page result.
|
|
|
|
|
|
|
Hi there,
actually this is a very common problem, but I do not see the solution. The situation is as follows. I have a decimal number. I want to convert it to a string without trailing zeroes, a dot as a decimal separator and a maximum of 17 digits.
Examples:
0.1234100 -> 0.12341
0.0 -> 0
0.00000196525616047 -> 0.00000196525616047 (not 1.96525616047E-06)
12123.12432 -> 12123.12432
DecimalValue.ToString("G17", nfi) gives me an exponential output.
DecimalValue.ToString("G", nfi) gives me trailing zeroes and more than 17 digits.
thanks,
Albi
modified on Wednesday, December 10, 2008 8:20 AM
|
|
|
|
|
Use DecimalValue.ToString("#.#################"); (reference here[^])
|
|
|
|
|
Oh boy, sometimes the solution is that easy and you just do not see it.
Thanks!
Albi
|
|
|
|
|
Hello everyone,
Are there API provided by Microsoft to convert video file of other types to Flash video file? If no such API provided by Microsoft, any API provided by other parties?
thanks in advance,
George
|
|
|
|
|
I'm pretty much sure that Microsoft won't have that kind of API, since Flash is Adobe's (ex-Macromedia's) proprietary file format (at least it was, I'm not sure if Adobe opened the specs)
You can check the NetFFMpeg[^] project, which is a .Net wrapper to ffmpeg[^]
Regards,
Lev
|
|
|
|
|
Thanks Lev!
I have tried the following code to embed a flash media player and embed a movie to play, which is bush.wmv. But the page is empty, do you know what is wrong please?
<html>
<body>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550" HEIGHT="400" id="myMovieName"><PARAM NAME=movie VALUE="D:\Bush.wmv"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="/support/flash/ts/documents/myFlashMovie.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
NAME="Bush" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
</body>
</html>
regards,
George
|
|
|
|
|
Well, I think this is not the right forum for this question
But anyway, I think the problem is that you are trying to play Windows Media file (wmv) with Adobe's flash player.
I think you should first convert the wmv to flv.
Regards,
Lev
|
|
|
|
|
Thanks Lev, I will try netffmpeg.
regards,
George
|
|
|
|
|
Hi Lev,
Sorry for interrupting again. I have tried FFDDL, the document is very limited. My purpose is just to convert to Flash format, so I think maybe Adobe could have some SDK to do that? Do you have any ideas?
regards,
George
|
|
|
|
|
Nope, sorry, I haven't done any conversions to flash myself, I just gave you a hint
Regards,
Lev
|
|
|
|
|
Thanks all the same, Lev!
regards,
George
|
|
|
|
|
You're welcome
Regards,
Lev
|
|
|
|
|
How can i build a program that hv two classes (child class and parant class) child class is inheriting from parant class.
Now child class has two methods
1.which returns the name of parant class
2.which returns the object of parant class
|
|
|
|
|
Hi
you could use reflection. This would be in the child class.
<br />
public string GetParentClassName() {<br />
return this.GetType().BaseType.Name;<br />
}<br />
Hmm, the child itself is an object of the parent class. Don't know exactly what you mean with this.
Regards
Sebastian
|
|
|
|
|
I am not sure what do you mean by saying the Name and Object of parent class,
but you can get the Type of the base class like this:
public class Dad {
}
public class Kid : Dad {
public Type GetParentType() {
return this.GetType().BaseType;
}
}
Regards,
Lev
|
|
|
|
|
thanks...
thats what i want...
this was my 1st post on this site...
i really like this platform...
|
|
|
|
|
Hi
when you create a class that inherit from another class you must specify the base class type, this is the solution for your question.
class Base
{
public Base()
{
}
}
class Derieved : Base
{
public string GetPerentName()
{
return typeof(Base).Name;
}
public Base GetPerentObject()
{
return (Base)this;
}
}
|
|
|
|
|
I have a little server application that gives feedback to the user in two ways, one is to write entries to a log file and secondly by writing those same entries to a TextBox on the main form. The main form actually has very little other than this TextBo x.
This server could run for months on end so I would like to limit the total number of lines in this TextBox to, let's say 1000, but on a FIFO basis. With a ListBox it would have been fairly simple - doing something like this, every time I add text to the control:
while (listBox1.Items.Count > 1000)
listBox1.RemoveAt(0);
Is there an elegant way of doing the same with a TextBox ?
|
|
|
|
|
Somewhat awkward solution is to do it like this:
textBox1.Text = textBox1.Text.Substring(textBox1.Lines[0].Length + Environment.NewLine.Length);
This isn't very effective, so maybe someone will offer a better solution...
Regards,
Lev
|
|
|
|
|
Why would you use a TextBox at all? A ListBox is the right Control for showing unrelated lines of text, as in a logging application. A TextBox trying to give the same scrolling text result would be concatenating and removing text strings all the time.
And if you were to need some formatting (bold line, red line), make it DrawMode=UserDrawn...
|
|
|
|
|
You just stole the word from my mouth
Sometime I use ListView also, it gives some nice features like columns etc. in Detailed view
Regards,
Lev
|
|
|
|
|
Good point. I liked the idea of being able to select any number of rows and copy it into the clipboard but that's probably not sufficient reason to use TextBox rather than ListBox.
|
|
|
|