2,157 Posted Topics
Re: First I'd like to say that these sites most likely won't like you doing this. You will have to make a lot of requests on their servers to keep prices up-to-date and they'll see this as either a DOS attack or contrary to their business desires (they don't want you … | |
Re: [code]Console.WriteLine("CC\t\t ## ##");[/code] | |
Re: Tag is your best bet. As for determining which one was selected, it's easy:[code]private void radioButton_CheckChanged(object sender, EventArgs e) { RadioButton rb = sender as RadioButton; }[/code] 'rb' is the one that was selected. You can now access all its properties, etc. without actually knowing which one it is :) | |
Re: It happens because you changed the text. I'd handle this by using this code:[code]Boolean shifted = false; private void textBox1_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.LeftShift || e.Key == Key.RightShift) { shifted = true; } else if (shifted == true && e.Key == Key.D4) { e.Handled = true; … | |
Re: [code]public string HumanChecker(string str) { if (str == this.RandomNumberGenerator()) { return "You are a human."; } else { return "You aren't a human!"; } }[/code] You do realize that this code is going to generate a new random number and that the odds that it will match what the person … | |
Re: Probably the easiest way is LINQ to SQL. What have you done so far? | |
Re: It should run as long as you don't exclude them (use x86 or any CPU, not x64) and the .NET framework that you are using is available for that OS. | |
Re: Not really, what are you trying to do? | |
Re: It's bad design for one form to manipulate the controls on another form. Your second form should send a message (event) to the first form so it can manipulate its own controls. | |
Re: What type is this [icode]GlobalClass1.globaldate = reader["start_date"].ToString();[/icode]? | |
Re: Take a look at [URL="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx"]this[/URL]. | |
| |
Re: Try something like this [code]var contList = (from c in contDoc.Descendants("Content") where (string)c.Attribute("Type") == str select c into ctemp where (string)ctemp.Attribute("Codec") == "H264" select new { Id = (string)c.Attribute("Id") }).ToList();[/code] | |
Re: IsNullOrWhiteSpace is a static method so you use it by class.method, i.e. [code]if (String.IsNullOrWhiteSpace(movie_title)) { Console.WriteLine("You must enter a movie title, noob!"); } else { // they entered a title, do whatever you want here }[/code] | |
Re: You could also just use the fallthrough on the case statement:[code]switch (response) { case 'm': case 'M': // code here break; etc... }[/code] And you have way to much code in your case statements. Make those methods. | |
Re: [code]private void button1_Click(object sender, EventArgs e) { int w = pictureBox1.Size.Width; int h = pictureBox1.Size.Height; int count = 23; Bitmap b = new Bitmap(w, h, System.Drawing.Imaging.PixelFormat.Format32bppArgb); w /= count; h /= count; Graphics g = Graphics.FromImage(b); for (int i = 0; i < count; i++) { for (int j = … | |
Re: Then you aren't very good at using google [url]http://yetanotherforum.net/[/url] | |
Re: You can put a panel on the form, put all the first page controls on it, put another panel and put all the second page controls. Then hide whichever panel you won't want to display. | |
Re: You should read [URL="http://msdn.microsoft.com/en-US/library/ms173084%28v=VS.80%29.aspx"]Deploying C# Applications[/URL] | |
Re: {} indicates a block of code so the compiler knows that it ends when it reaches a closing }. ';' is used to mark the end of a statement so the compiler knows that you are done with that statement since C# ignores white space (except where significant). You could … | |
Re: Technically, the name of the class is "System.Console". | |
Re: Set the OutputAssembly property of the CompilerParameters object to the location and name you want to use. | |
Re: A recursive method using non-subtractive roman numerals:[code]using System; using System.Text; namespace ConsoleApplication1 { class Roman { String[] digits = { "", "i", "ii", "iii", "iiii", "v", "vi", "vii", "viii", "viiii" }; public String Convert(int number) { String result = String.Empty; if (number >= 10) { result = MultiplyBy10(Convert(number / 10)); … | |
Re: [url]http://en.wikipedia.org/wiki/Linux#Programming_on_Linux[/url] | |
Re: Arrays are numbered from zero up, so your line 6 creates an array with elements [0] and [1]. That should be enough for you to fix your problem. | |
| |
Re: Not sure what the problem is. Clicking on button6 adds a click handler for button7. Clicking on button7 should fire the handler. | |
Re: Line 11 will never be true for any value that is not a power of two. Because of this you never will reach line 13 for these values so the value of 'f' won't change. You then, in line 51, call the method again [I]with the exact same value you … | |
Re: Well if you disable the control, of course it isn't going to have events as it's [B][I]disabled[/I][/B]. MouseClick does fire for ReadOnly, so not sure what your problem is there. | |
Re: You can just stop the service, copy all changes (exe and dlls if any) and start it back. | |
Re: [QUOTE=destruct0;1628130]WindowsForm windowsForm = new WindowsForm(); windowsForm.Show(); It shown for a moment after that the form closes itself.[/QUOTE] Provide the whole method that is in. I suspect the method ends right after the Show, which makes the variable windowsForm go out of scope, which closes the window. | |
| |
Re: [CODE]private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Enter) { textBox1.Select(0, 0); } }[/code] | |
Re: Using a regular expression is easier: [code]if (Regex.Match(textBox.Text, @"^\d{6}[mg]$").Length > 0) { // it's a good ID number }[/code] This expression requires that there be 6 digits followed by either an 'm' or a 'g'. That is also the only thing allowd ("123456mt" doesn't work, where it would work with … | |
Re: That means it can't find that assembly. Do you have it installed? Where is it installed? Is it part of the GAC? | |
Re: 1) Yes 2) [URL="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx"]Process.Start()[/URL] No free ones that I know of, but there is [URL="http://www.tangiblesoftwaresolutions.com/Product_Details/CSharp_to_CPlusPlus_Converter_Details.html"]this[/URL]. | |
Re: You want to limit the number of checked items in a CheckedListBox. What property of CheckedListBox tells you what is checked? Once you have that, is there some way to Count them? | |
Re: Does the MessageBox from line 119 show up? | |
Re: Pull the datasource into some collection (List<T> comes to mind) and add your item then bind the list to the control. | |
Re: It is possible to use character frequency statistics to help crack the 'name' cipher. All you need to do is divide the encrypted text into three groupings (since we know the key is three characters long), determine the frequency of each group and XOR the highest frequency in each group … | |
Re: Impossible for us to tell what you are doing without actually seeing what you are doing. | |
Re: Can you repeat characters? | |
Re: In general you can't declare methods inside methods (multiply is inside main). And you can have private classes, no matter what Mitja says :) | |
Re: First Question: Those are static methods. Also known as class methods. Second Question: That's not a constructor. Constructors don't have a explicit return type, while this one does (double). | |
Re: Line 19 says if you have an error loading the file, you ignore it. This may be the source of your problem. If you are going to put a 'try' block, catch an exception! Display something. I suspect it is failing there and _flashCard (who ever told you naming variables … | |
Re: MessageBox is a Winform object. Based on the 'ConsoleApplication10' I'd say you are writing a Console application, thus, no MessageBox. If you want output, use Console.WriteLine. Oh, and there is no recursion anywhere in that code. | |
Re: Here is an example using a label and two buttons [code]using System; using System.IO; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { String[] theText; int position = 0; public Form1() { InitializeComponent(); theText = File.ReadAllLines(@"D:\My Workspaces\Windows Phone 7 Solution\SimpleFlashCard\EnglishFlashCard.txt"); if (theText.Length < 1) throw new FileLoadException("There … | |
Re: This is not the Knapsack problem as you only have one constraint (volume). Calculating value/cm3 is easy: You have value/gram and gram/cm3. Multiply the two and you get value/cm3 (the grams cancel). Sort high to low (or use the Heapify function of [URL="http://en.wikipedia.org/wiki/Heapsort"]heapsort[/URL] which would be faster, but probably overkill … | |
Re: Add a handler to the SelectedIndexChanged[code]private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e) { int i = checkedListBox1.SelectedIndex; checkedListBox1.SetItemChecked(i, !checkedListBox1.GetItemChecked(i)); }[/code] This does have an issue that it's now harder to unselect an item :) | |
Re: [URL="http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx"]Characters allowed[/URL] Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following: [LIST] [*]The following reserved characters: [LIST] [*]< (less than) [*] > (greater than) [*] : (colon) [*] " (double quote) [*] / … |
The End.