2,157 Posted Topics
Re: add [icode]openFileDialog1.MultiSelect = true;[/icode] after line 27. And in line 31 you are going to have to pass the file names to your intelhextobin method. | |
Re: How is the web browser control messing up your application is what I'd like to know :) Have you tried handling the Navigating event and setting the Cancel property to true? | |
Re: This will do what you want. It's an extension method to the class StreamReader:[code]using System; using System.IO; using System.Text; namespace ExtensionMethods { static class Extensions { public static String ReadLine(this StreamReader sr, char c) { StringBuilder sb = new StringBuilder(); int character; if (sr.EndOfStream == false) { do { character … | |
Re: Problem is that you are trying to insert a string into a decimal field in the database. Remove the single quote (') marks from your SQL statement or learn to use [URL="http://dev.mysql.com/doc/refman/5.0/es/connector-net-examples-mysqlparameter.html"]Parameters[/URL] | |
Re: Where do you save the results of these dialogs? Where do you set the RTF font and color? | |
Re: [url]http://www.face-rec.org/algorithms/[/url] | |
Re: It's a window with a rich text box. I'm not sure what you are trying to ask here. | |
Re: [QUOTE=thines01;1623797]Inside your ChangeCase method, I would convert the string to a CharArray [/QUOTE] There is no need to do this. You can treat a String as if it was already a character array. [code]using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { String test = "this … | |
Re: Here is an example I wrote using a CheckedListBox, a Label, and a Button: [code]using System; using System.Collections.Generic; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); List<MyData> data = new List<MyData>(); checkedListBox1.Items.Clear(); for (int i = 0; i < 10; i++) { … | |
Re: Run it outside of Visual Studio and check if it inserts the record. | |
Re: [code]foreach (int item in checkedListBox1.CheckedIndices) { checkedListBox1.SetItemCheckState(item, CheckState.Unchecked); }[/code] Selected and Checked are two different states so that is why your code doesn't work. There isn't an easier way. | |
Re: Try using [icode]reader["someField"].GetInt32()[/icode]. I'm not sure if the MySql connector supports indexed columns this way, so you may have to use [icode]reader.GetInt32(<column number of "someField">)[/icode] i.e. [icode]reader.GetInt32(4)[/icode]. | |
Re: Can you translate the message into English? Does it say something about connection already in use? | |
Re: It's awkwardly worded. When you call the print method on the p2 object, you technically are calling that classes method. When you call it on the p1 object, you are 'overriding' the base class method with the derived classes method. | |
Re: By writing code to read the video files and combining them. This is a vague question which leaves a lot out. What type of files? Do you have a codec for the files or do you have to write your own? What do you mean by 'join'? What have you … | |
Re: It's an explicit indication that it doesn't support fall-through, for people who are coming to C# from other languages. | |
Re: [LIST] [*]Create a form and add a picture box of size 201, 201. [*]Set the BackColor of the picture box to Black [*]Add a label, a button and a timer. [*]Set the Timer Tick event to timer1_Tick. [*]Set the button click event to button1_Click. [*]Set the timer interval to whatever … | |
Re: We image the drive then restore it when needed. I'm not sure if there is any free drive imaging software out there (well, there is [URL="http://www.runtime.org/driveimage-xml.htm"]here[/URL]. It's best to make the testing partition as small as possible as this will speed up the restore (you only need to image once). | |
Re: Depends on what you mean by delete and what type of file. For example, I have a text file with lines in it like these: [code]Line 1 Line 2 Line 3 Line 4[/code] I delete "Line 2" do I get:[code]Line 1 Line 3 Line 4[/code]or[code]Line 1 Line 3 Line 4[/code] | |
Re: I know this is closed already, but it says in the C# standard "Bitwise operators are predefined for int, uint, long, and ulong", and this is why the byte is cast into an Int32. | |
Re: If you open a connection to the database, .NET actually opens multiple connections to that database (the connection pool). This is done to speed up future connections (in your program) that you might need. Even if you close all your connections, .NET maintains its open connections in case you might … | |
Re: Change lines 12 and 13 in your first code block to read[code] textBox1.Text = reader.ReadLine(); textBox2.Text = reader.ReadLine();[/code] | |
Re: Android Phones, Windows, iPhone, Windows Phone, XBox-360, Linux, OSx - Looks multiplatform already. | |
Re: [QUOTE=ddanbe;1621563]Line 3 : [COLOR="Red"][B]sql statement[/B][/COLOR] is no code in whatever computer language, so it is very hard to translate.. You could just as well try to translate a poem to C#, it will not work.[/QUOTE] For loop Haiku: [code]For(int i = 0; i < theString.Length; i = i + 1) … | |
Re: Write a program that: [LIST=1] [*]Connects to another user of your program. [*]Captures the image from the webcam. [*]Sends the captured image to the other program. [*]Receive image from other program. [*]Display image. [*]Repeat steps 2-5 [/LIST] Personally, I'd establish two connections (send/receive) and run this as two threads (steps … | |
Re: You do want tables for Team and Card Comp with IDs linking from the main record. ID (a number) is at most 4 bytes. A team name can be much longer and you'll save space. Also, if you tell the database to index on the ID field, searches will be … | |
Re: [code]byte[] myData = File.ReadAllBytes("Some.exe"); myData[2342] = 0x00; File.WriteAllBytes("Some.exe", myData);[/code] | |
Re: Ok, the first problem ('a' + i). The compiler sees that i is an Int32 so it casts the character 'a' into an Int32 and does the add. The (char) outside the math converts it back into a character. Second problem. The logic truth table for AND is [CODE]Bit 1 … | |
Re: Line 5 makes a lot of assumptions (there will be ContentErrs and TestID and Errors and Error). I'd break that up into individual checks [code]IEnumerabel<XElement> contentErrs = doc.Root.Elements("ContentErrs"); if (contentErrs != null) { ...[/code] Something like that. | |
Re: Of course it only happens one time, you have no loop construct in your code to make it happen more than once (no for, no foreach, no while or no do/while). And that is some really ugly code. Do you know what an array is? Step back a bit, learn … | |
Re: No, 600 isn't the limit for the size of an array. Without seeing your code I can't tell you why you are exceeding your array size. | |
Re: [QUOTE=auwi987;1616779][code]MySqlCommand cmdCheck = new MySqlCommand("select UserName, Password from tblUser where Username='"+txtUserName.Text+"' and Password='"+txtPassword.Text+"'", cls_con.cn);[/code][/QUOTE] Learn to use Parameterized queries. What happens if someone types in "blah'; drop table tblUser;" in the password box (exclude the " but keep everything else)? | |
Re: We need a lot more information than "it's telling me Error". What error, exactly, is it giving. What line, exactly, is the error occuring. You should catch specific exceptions, not the generic "catch" you are using. You don't even bother to get the exception object so you can see more … | |
Re: you are trying to assign a string ("Price") to a decimal field. Is Price a variable in your code? If so, remove the quote marks. If not, you need a decimal value to assign to it. | |
Re: There is nothing wrong with the code. If works exactly like it is supposed to. What makes you think it gives the wrong value? | |
Re: It's the character that is the shifted \ key = | || means "or" with the properties that if the part on the left of the || is true, the part on the right of the || is never evaluated (known as short circuiting). This can be done because in … | |
Re: Create a FtpWebRequest and set the Method property to what you want. Then call GetResponse() to get whatever data you need. Set the Method again, call GetResponse() again, etc. until you are done. | |
Re: Uninstall XNA Game Studio and then download and install [URL="http://www.microsoft.com/download/en/details.aspx?id=13890"]Windows Phone Development Tools[/URL]. The stand alone XNA is mainly for XP users and can be a pain to get working. | |
Re: You only need to license it if you are going to distribute it (which is what it says). | |
Re: I use the built in Settings class. If you want control, it does allow you to specify your own settings file to load/save. | |
Re: Visual Studio works great once you set the formatting parameters how you like them. Just delete the closing } in any file and retype it and it will reformat the file. And there is no industry standard. There are two conventions that are the most popular 1: Brace on following … | |
Re: Not sure what you consider the normal solution, but you only have to iterate through the list one time giving an O(n) solution. Not sure what craziness you'd have to do to make it O(n^2). Given array A[], L and R. [CODE]If L > R output 0 and stop Set … | |
Re: [QUOTE=Huntondoom;1616654][CODE]textbox1.text = string.format("00.00", A.ToString()) + "%"[/CODE][/QUOTE] Why would you append a string to a string format (and your format is wrong :)) [code]textbox1.Text = String.Format("{0:00.00}%", A.ToString());[/code] | |
Re: Use the [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx"]Screen[/URL] class to get the size of the display and resize the form. | |
Re: [QUOTE=DeathEater;1616485]if even it is possible to make a compiler with a HLL like C#, but you have to know how to code in assembler, that is mandatory[/QUOTE] It is very possible to create a compiler in C# and you don't need to know assembler at all. Using the Emit methods … | |
Re: Why do you need to serialize a byte array into a byte array (which is what Binary Formatter really is)? Just transfer the array, don't serialize it. And yes, you can write a byte array to a file (and read it back) with [URL="http://msdn.microsoft.com/en-us/library/system.io.file.writeallbytes.aspx"]File.WriteAllBytes[/URL] (and [URL="http://msdn.microsoft.com/en-us/library/system.io.file.readallbytes.aspx"]File.ReadAllBytes[/URL]) | |
Re: Something like this should work:[code]Uri myUrl = new Uri("file://google.com/textfile.txt"); FileWebRequest myFileWebRequest = (FileWebRequest)WebRequest.Create(myUrl); FileWebResponse myFileWebResponse =(FileWebResponse)myFileWebRequest.GetResponse(); Stream receiveStream=myFileWebResponse.GetResponseStream(); StreamReader readStream = new StreamReader( receiveStream ); char[] readBuffer = new Char[256]; int count = readStream.Read( readBuffer, 0, 256 ); StringBuilder sb = new StringBuilder(); while (count > 0) { sb.Append(readBuffer, 0, … | |
Re: You'll need to set up a message format with some form of code to indicate what type of message it is. If you look up a messaging protocol, you'll see they use the first few bytes of each message to tell the server what they are trying to do. So … | |
Re: Unless you are multithreading, thread sleep is a poor way to time things. Use a timer control and in the tick event change your picture. |
The End.