2,157 Posted Topics

Member Avatar for vaishnu

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.

Member Avatar for Momerath
0
185
Member Avatar for Wheen

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?

Member Avatar for Wheen
0
90
Member Avatar for C#Jonathan

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 …

Member Avatar for Momerath
0
500
Member Avatar for dennysimon

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]

Member Avatar for Momerath
0
180
Member Avatar for LordRiq

Where do you save the results of these dialogs? Where do you set the RTF font and color?

Member Avatar for Momerath
0
190
Member Avatar for nishant969
Member Avatar for Panathinaikos22

It's a window with a rich text box. I'm not sure what you are trying to ask here.

Member Avatar for ddanbe
0
278
Member Avatar for king03

[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 …

Member Avatar for duke_swh
0
389
Member Avatar for king03

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++) { …

Member Avatar for duke_swh
0
151
Member Avatar for stfent
Member Avatar for Momerath
0
229
Member Avatar for king03

[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.

Member Avatar for king03
0
105
Member Avatar for d87c

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].

Member Avatar for Momerath
0
132
Member Avatar for stfent

Can you translate the message into English? Does it say something about connection already in use?

Member Avatar for Momerath
0
127
Member Avatar for dotancohen

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.

Member Avatar for dotancohen
0
151
Member Avatar for adobe71

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 …

Member Avatar for Momerath
0
78
Member Avatar for dotancohen

It's an explicit indication that it doesn't support fall-through, for people who are coming to C# from other languages.

Member Avatar for dotancohen
0
178
Member Avatar for learner321

[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 …

Member Avatar for Momerath
0
188
Member Avatar for zachattack05

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).

Member Avatar for Ketsuekiame
0
114
Member Avatar for fashxfreak

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]

Member Avatar for Momerath
0
95
Member Avatar for Cainer

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.

Member Avatar for Momerath
0
136
Member Avatar for bhagawatshinde

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 …

Member Avatar for bhagawatshinde
0
387
Member Avatar for kytro360

Change lines 12 and 13 in your first code block to read[code] textBox1.Text = reader.ReadLine(); textBox2.Text = reader.ReadLine();[/code]

Member Avatar for kytro360
0
139
Member Avatar for james6754

Android Phones, Windows, iPhone, Windows Phone, XBox-360, Linux, OSx - Looks multiplatform already.

Member Avatar for Ketsuekiame
0
121
Member Avatar for cocoll

[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) …

Member Avatar for ddanbe
0
234
Member Avatar for moshe12007

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 …

Member Avatar for Momerath
0
104
Member Avatar for Geodude0487

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 …

Member Avatar for lolafuertes
0
105
Member Avatar for Silent-Regret

[code]byte[] myData = File.ReadAllBytes("Some.exe"); myData[2342] = 0x00; File.WriteAllBytes("Some.exe", myData);[/code]

Member Avatar for Silent-Regret
0
255
Member Avatar for james6754

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 …

Member Avatar for Momerath
0
196
Member Avatar for CSharpUser

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.

Member Avatar for CSharpUser
0
455
Member Avatar for singh_soorma94

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 …

Member Avatar for singh_soorma94
0
305
Member Avatar for Slyvr

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.

Member Avatar for Momerath
0
272
Member Avatar for auwi987

[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)?

Member Avatar for auwi987
0
106
Member Avatar for ©lick

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 …

Member Avatar for Momerath
0
258
Member Avatar for dennysimon

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.

Member Avatar for dennysimon
0
2K
Member Avatar for Domtheripper

There is nothing wrong with the code. If works exactly like it is supposed to. What makes you think it gives the wrong value?

Member Avatar for Domtheripper
0
125
Member Avatar for techlawsam

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 …

Member Avatar for techlawsam
0
2K
Member Avatar for darkelflemurian

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.

Member Avatar for Momerath
0
127
Member Avatar for corby

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.

Member Avatar for Momerath
0
78
Member Avatar for zachattack05

You only need to license it if you are going to distribute it (which is what it says).

Member Avatar for zachattack05
0
312
Member Avatar for zachattack05

I use the built in Settings class. If you want control, it does allow you to specify your own settings file to load/save.

Member Avatar for zachattack05
0
71
Member Avatar for C#Jonathan

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 …

Member Avatar for ddanbe
0
193
Member Avatar for hqt

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 …

Member Avatar for TrustyTony
0
493
Member Avatar for complete

[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]

Member Avatar for nmaillet
0
354
Member Avatar for westony

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.

Member Avatar for westony
0
618
Member Avatar for Angle90
Member Avatar for shridharmaster

[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 …

Member Avatar for Momerath
0
345
Member Avatar for zachattack05

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])

Member Avatar for zachattack05
0
108
Member Avatar for Jazerix

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, …

Member Avatar for Jazerix
0
223
Member Avatar for Mitja Bonca

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 …

Member Avatar for l3l4c7_h4t
0
430
Member Avatar for galhajaj

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.

Member Avatar for galhajaj
0
217

The End.