|
How to down size video file(mpeg, AVI, wmv)
- reduce bitrate video and bitrate audio
- reduce resolution
use C# code and detail
I want to see code and detail
|
|
|
|
|
How to reduce bitrate for music(mp3, wave, wma)
I want to reduce bitrate for music(mp3, wave, wma) with C#
I want to see code and ditail
|
|
|
|
|
Here's[^] a bit of an example on CodeProject.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to run a program when the computer is locked. Is there any easy way in C# to determine if a computer is locked?
|
|
|
|
|
Can you show me some examples about the diffence between Binary and Text file?Thank a lot.
Nothing
|
|
|
|
|
The only difference is how you read from it and write to it.
When you read from a binary file, you read bytes, and when you write, you write bytes.
When you read from a text file, you read characters. One character can be one or more bytes, depending on the encoding you choose to use. When you read the character it will be converted to unicode, as that is the encoding used by the Char data type. When you write to a text file, the unicode characters will be converted to one or more bytes, accordning to the encoding you choose to use.
---
b { font-weight: normal; }
|
|
|
|
|
Another obscure difference is how some daemons transfer files. Take FTP, for example. When you transfer files using ASCII mode line-termination characters are converted from the host (server) platform to the client platform automatically. This isn't transcoding (coverting encodings) but changing the way line-terminate and new-line characters are handled on the target platform. In BINARY mode the file is downloaded as-is.
Another thing typically of text files is a byte order mark, or BOM. ANSI files (ASCII characters are the first 127 bits) are 1 byte characters and multi-byte files derive from ANSI and may be up to 4 bytes. This is similar to UTF-8 which is a multi-byte standard. Unicode is either 2 byte or 4 byte characters (UCS-16 and UCS-32). Crazy, huh? How do you tell the difference?
Enter BOMs. ANSI files won't have them (no standard is defined anyway), but UTF-7, UTF-8, and Unicode files will have BOMs to help application like web browsers identify the encoding so the characters can be displayed correctly. Browsers and other application may also employ heuristics to guess the encoding if not explicitly mentioned (in browsers the encoding is described in HTTP headers or META tags in the content).
Binary files are what they are - a stream of bits that you interpret as the bits themselves - no encoding, no new-line or line-termination characters, no BOM...just as-is data.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
-- modified at 21:18 Friday 20th January, 2006
|
|
|
|
|
How about the structure of data to write in a file?
Nothing
|
|
|
|
|
What about it? The structure is determined by the person who wrote the application that wrote the file.
Or did I misunderstand your question.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I'm using the browser control of vs.net 2005 and what I am trying to do is to display a file like an image via stream and not using the physical file path. Can this be done? I have tried using the DocumentStream property but only displays the file in garbled text.
Many thanks.
|
|
|
|
|
Using the WebBrowser.DocumentStream property is correct but it depends on what your stream contains. What are the contents of your stream? The stream can only contain plain text. Anything else will just be interpreted as plain text, so binary files will not be interpretted or handled correctly.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I guess I am out of luck since I am trying to display a stream of image and a pdf. Oh well, thanks.
|
|
|
|
|
You're not out of luck - there's just not a simple solution. The WebBrowser control is an ActiveX container and hosts things like MSHTML (the rendering engine for IE), Word, Acrobat (Reader), etc. It involves getting RCWs (runtime callable wrappers - a managed interface wrapping a native COM interface) and loading an IPersistFile interface (or a small handful of other, similar interfaces). Of course, you could always just navigate to the file and IE (a la the WebBrowser control) will take care of the rest.
For the former method, search for "WebBrowser.DocumentStream" and you'll find some helpful tips.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
First, I apologize if this is not the proper forum to ask my question.
I have a .NET 2.0 Windows Form App which uses BindingNavigator, BindingSource and DataSet.
The user can use the AddNew and Delete buttons of the BindingNavigator to Add/Delete records to the underlying typed DataSet.
In my particular case, I'm showing a Work Order record whose PK is also the table's IDENTITY field (MS SQL 2005).
My DataSet is setup with negative increment for this PK in order to avoid clashes.
So, when the user clicks the AddNew button, he sees a negative Work Order number showing up until the Update method is called on the TableAdapter. This could be a source of confusion in some users, so I'd like to proceed differently.
Should I handle this field manually, getting from the DB the highest Work Order number right when the record is created in the DataSet ? If so, how do I take care of concurrency in the case another user also creates a new Work Order before first user actualy commits his new record ?
Or should I simply call Update right away when the record is created ?
I assume this is a very common issue in DB programming.
Thank for any tips.
Luc Morin
|
|
|
|
|
There is no way of knowing for sure what id a record will get until it's created. If you use any method to guess the id (e.g. from the previous records), you might get it right most of the time, but not all the time.
If you handle the id manually, you still won't get it right all the time. Sometimes some other user will have created a record, so the insert will fail. Then you would have to handle the error condition, give the id a new number and try to save it again. This might be acceptable, but one big drawback is that the more users you have, the more frequently this will happen.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: There is no way of knowing for sure what id a record will get until it's created. If you use any method to guess the id (e.g. from the previous records), you might get it right most of the time, but not all the time.
Yes, this is exactly my concern.
How do most apps handle this situation ? I was thinking of making the Work Order TextBox invisible until the user actuallty saves the record.
What do you think ?
Regards,
Luc Morin
|
|
|
|
|
You could make a call to a stored procedure that just creates a blank record in the table. The autoincremented value (ID) gets created, then the SP returns just that ID. You're code can then show a blank edit form so all the details can be filled in. Then the record can be written back to the table with the "checked-out" ID number.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I’m missing something (I’m experienced with C, C++ but not with C#, ASP.NET)...
I want to dynamically create a control/random HTML. Do I have to do it with, for example,
<br />
HtmlTable table1 = new HtmlTable();<br />
table1.Attributes.Add("border", "0");<br />
table1.Attributes.Add("align", "center");<br />
div1.controls.Add(table1);<br />
etc. or can I pass ‘<table border=”0” align=”center”>...</table>’ to something and have it render it?
Rog
-- modified at 14:41 Friday 20th January, 2006
|
|
|
|
|
You don't have to render it if it's already html code. You put it on the page.
Use for an example a placeholder:
<asp:Placeholder id="Arthur" runat="server"/>
Add a literal control containing the html code:
Arthur.Controls.Add(new LiteralControl("<table ... > ... </table>"));
---
b { font-weight: normal; }
|
|
|
|
|
Excellent, thank you.
I already have an 'Arthur' to hang things off. So, to do the dynamic bits, I can just adjust the string or use Arthur.FindControl("x") afterwards to adjust it.
It's these things like not knowing about LiteralControl which are the 'things you don't know you don't know' that make forums like this so worthwhile!
Thanks again.
Rog
|
|
|
|
|
I want to design a program that operate in the following:
click a button--> OpenFileDialog, chose the pic that u want to copy.... If DialogResult.OK --->the selected picture is copied to folder \bin\debug with the name "copied.gif"
Help me, pleaseeeee
|
|
|
|
|
So what's your problem? A picture is a file just like any other so just use File.Copy. Or did you want to convert formats?
|
|
|
|
|
OpenFileDialog openFile = new OpenFileDialog();
openFile.Filter = "Image files|*.tif;*.tiff;*.bmp|All files (*.*)|*.*";
if (openFile.ShowDialog() == DialogResult.OK)
{
File.Copy(openFile.FileName, Application.StartupPath +"\\coped.gif");
}
-- modified at 15:45 Friday 20th January, 2006
|
|
|
|
|
and...
how to create a folder and save my file to that folder???
In OpenFileDialog, filter, how to display in the textbox "File of type" like:
Image File (*.gif;*.jpg;*.bmp)
thanks
|
|
|
|
|
Before saving a file to a particular folder, it is a good practice that you check the folder's existence.
Review the following code:
string MyFolderDir = "C:\\MyFolder\\";
if(!Directory.Exists(MyFolderDir )) // if your folder does not exist
{
Directory.Create(MyFolderDir); // create the folder on the specified directory
}
In the "File of Type" dropdown, you just need to specify the text that would appear and the filter. You can separate them using the "|" character. Like this:
openFile.Filter = "Image File (*.gif;*.jpg;*.bmp)|*.gif;*.jpg;*.bmp";
Microsoft KB and other sites such as this have very good articles about File operations. Try exploring. Enjoy!
-- modified at 9:45 Saturday 21st January, 2006
|
|
|
|