2,157 Posted Topics
Re: [QUOTE=ctrl-alt-del;1512914]Is this at all possible using C# (managed code vs unmanaged code and all that)?[/quote]Yes it's possible using unsafe code in C#. [quote]Can it be done if you don't have access to the code?[/quote]Yes, but you'll have to reverse engineer their code to figure out where to insert your detour/trampoline … | |
Re: You use a lot of buzzwords without defining them. Why should I care about OP? | |
Re: Most likely you want to take a look at [URL="http://msdn.microsoft.com/en-us/library/microsoft.win32.registrykey.setaccesscontrol.aspx"]RegistryKey.SetAccessControl[/URL] | |
Re: [code]dt.Rows[0][1].ToString("hh:mm");[/code] | |
Re: If you want exhaustive bruteforce then just have 8 loops going from column position 1 to 8. Each loop represents a row. Take the 8 positions and see if it is a solution. Continue until done. It's only 16,777,216 different positions. | |
Re: Car dealers in my area use a killswitch system. If you are over 1 month late on payments your car will fail to start until you are current. This is used by the 'we finance anyone' dealers. | |
Re: [code]String myString1 = null; // null string String myString2 = ""; // Empty string[/code] In the first case, there is no object assigned to the string. You can't call any of the string methods on it. In the second case, there is an object, it just contains nothing. | |
Re: [code]String[] lines = File.ReadAllLine("filename"); Array.Sort(lines); File.WriteAllLines("filename", lines);[/code] 50 MB is nothing to a modern computer. In memory sorting will be faster than anything else. As a test I created a 54 MB file consisting of 1,470,588 strings. It took 1.729 seconds to read the file, 17.487 seconds to sort it … | |
Re: Check [URL="http://www.codeproject.com/KB/miscctrl/ruler.aspx"]here[/URL] | |
Re: What have you got so far? You need to: Open file for reading While there are more lines Read a line Split line into parts Put parts into correct fields End While Close file Work on doing each one of those, and you'll be done. | |
Re: [code]string ChangeString(String word, String current, char test) { if (word.Length != current.Length) { throw new ArgumentException("Error: word and output must be same length"); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < word.Length; i++) { if (word[i] == test) { sb.Append(word[i]); } else { sb.Append(current[i]); } … | |
Re: I've been programming in C# for over 6 years now, and I learn new stuff every day. And to answer your question, no, C++ doesn't count. HR people don't really understand programming, and are given requirements to hire people. They want to see 3+ years of documented C# programming. | |
Re: You need to read [URL="http://msdn.microsoft.com/en-us/magazine/cc302121.aspx"]this[/URL], I know it's long, but it gives you everything you need to know to create the files you need to give so that your class documents are available to others. | |
Re: I'm not sure what more you want. The wikipedia page has all the information you need to understand TEA, with links to papers/websites that provide even more information. What you probably need is a better basic understanding of block cyphers. | |
Re: This might be beyond your current abilities but I'd keep a Dictionary<String, Dictionary<String, double>> of the values. The first key would be the from units, the 2nd key the to units and the value the conversion rate. You could then use Dictionary.Keys to populate a dropdown list of From units. … ![]() | |
Re: [code]this.dataGridView1.Columns["MyColumnName"].DefaultCellStyle.Format = "hh:mm";[/code] Should do the trick assuming you've converted the data to a DateTime. | |
Re: wireless networks don't have the equivalent of a cross-over cable. You'll need some third device for them to connect to. | |
Re: In your BackgroundWorker you are accessing a collection in a Thread unsafe manor. You need to lock replay during the entire process or you'll have issues if something else accesses it. Does codeFile.ExecuteAll make changes to replay? | |
Re: [QUOTE=Mitja Bonca;1509960]You cad do it like: [CODE] string answare = "j"; bool again = (answare == "j" || answare == "J") ? true : false; [/CODE] [/QUOTE] No need for the ? : part, it will return true/false anyway. You can also just do: [code]bool again = answare.ToUpper() == "J";[/code] | |
Re: In line 1 you declare that you are going to return a decimal. Where is the [icode]return[/icode] statement in your code? | |
Re: Get rid of lines 24 and 25 (and all the extra blank lines). You are doing this in the do/while loop, which is what you need to do. Replace lines 41 and 50 with [icode]bError = true;[/icode] or you will only ever get one value even if it is wrong. … | |
Re: The problem is that "manything to execute" is not allowing the UI thread any time to draw frm2. Put [icode]Application.DoEvents();[/icode] right after your frm2.Show() command. That should allow the UI thread to finish showing your frm2. | |
Re: I do it because I like to solve problems, educate people and educate myself. I tend to answer questions in the C# forum (with occasional trips to other languages). As of .NET 3.5 there are 11,417 different types. I can't even begin to think about how to learn anything about … | |
Re: No mistake, from the documentation: "The computer running the instance SQL Server might not receive responses to the EnumAvailableSqlServers method in a timely manner. The returned list might not show all the available instances of SQL Server on the network. When you call the EnumAvailableSqlServers method in subsequent tries, more … | |
Re: The bad way is to change line 37 to read [icode] a += ...[/icode] (same with line 47, change it to [icode] b += ...[/icode]. The good way is to learn to use [URL="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx"]StringBuilder[/URL] | |
Re: Anything in the project will be compiled if it needs to be (if you compile, make changes to one file, then compile again it just recompiles the one file and the final exe/dll to save time). | |
Re: Smells like ... homework. What have you done so far? | |
Re: What do you mean that the type of value is uint? uint doesn't have a .Text property so I have no idea what you are talking about. Post some code, because I can't recreate this issue at all. | |
Re: I don't see how you get your last output from the two lists you provided. | |
Re: I've solved 80 of them using F# as I'm trying to learn F# and figure this is a good way to go about it :) | |
I'm considering contributing to Daniweb but I notice that you only use Paypal. Due to several things I refuse to use Paypal. Is there another way that we can contribute? | |
Re: Get Firefox browser and the plugin YSlow. It will tell you exactly what is taking time on your page and suggest ways to fix it. For example, it gives this page: [I]Grade F on Make fewer HTTP requests This page has 40 external Javascript scripts. Try combining them into one. … | |
| |
Re: [code]private void CLICK2_Click(object sender, EventArgs e) { string file1 = @"C:\Users\Fish\Desktop\fyp-coding\sample1.txt"; string file2 = @"C:\Users\Fish\Desktop\fyp-coding\sample2.txt"; string[] lines = File.ReadAllLines(file2); File.AppendAllLines(file1, lines); myRichTextBox.Lines = File.ReadAllLines(file1); }[/code] | |
Re: To get a little technical, a DataSource is something that implements one of the following interfaces: [URL="http://msdn.microsoft.com/en-us/library/system.collections.ilist.aspx"]IList[/URL], [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.ilistsource.aspx"]IListSource[/URL], [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.ibindinglist.aspx"]IBindingList[/URL], [URL="http://msdn.microsoft.com/en-us/library/system.componentmodel.ibindinglistview.aspx"]IBindingListView[/URL]. You can read more about it [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.datasource.aspx"]here[/URL]. | |
Re: This will read lines and get new ones that are added to the file as they are added. You'll have to come up with a way to end the loop though :) [code]FileStream ins = File.Open(@"d:\test.txt", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); StreamReader sr = new StreamReader(ins); String line; while (true) { if … | |
Re: [code] public string CheckingValue(string Value) { long value = 0; string str = null; if (Value.Length == 10 && long.TryParse(Value, out value)) { str = String.Format("{0:(###) ###-####}", value); } return str; }[/code] Check the return value for null and display an error message if it is. | |
Re: One cause of this error is having something else already running that is trying to use the same port. Check your processes and make sure you don't have something running that shouldn't be (like previous versions of your software). Otherwise, I'd contact the creators of the XMPP library you are … | |
Re: Get a copy of [URL="http://www-cs-faculty.stanford.edu/~uno/taocp.html"]The Art of Computer Programming[/URL]. Find a topic you like and look at the problems at the end of the chapter. They range from simple to "this is my PhD thesis". Solve one and present the problem and your solution. | |
This snippet shows how to use Mutex to prevent multiple copies of your software from running. For a WinForms application, this code goes into the Program.cs file. The magic starts in line 14 where we attempt to create a Mutex. A Mutex is a form of a lock, but it … | |
Re: [code]public void DeleteDirectories(String[] directories) { foreach (String dir in directories) { Directory.Delete(dir, true); } }[/code] Code will throw exceptions if it encounters problems which means some directories may have been deleted and others not. | |
Re: Without your code it's hard to fix it, but set a boolean to indicate if the counter has been incremented. | |
Re: Line 7 is a reference to a function that takes a pointer to a string, a pointer to a character and returns an integer. In C# we call these delegates. It looks to be some form of SQL parser. | |
Re: I want you to make some attempt at writing the code first. | |
Re: I'm unemployed because my work was given to two people in India. That count for you? | |
Re: [QUOTE=NewOrder;1505825]cant i modify one object type without effecting the other?[/QUOTE] Yes you can, somewhere in your code you are setting them to the same reference. Or you've never set any of the values in the first place. | |
Re: Checking who's logged in won't work if the system is accessing the file. There is no real way to check who is accessing a file in C# as it requires hooking into the OS. There is a command you can download from Microsoft called [B]handle[/B] that will tell you what … | |
Re: [code]private void button1_Click(object sender, EventArgs e) { SortedList<String, int> items = new SortedList<string,int>(); String fileName = SelectFile(); if (fileName != null) { using (StreamReader sr = new StreamReader(fileName)) { while (sr.EndOfStream == false) { String line = sr.ReadLine(); String[] parts = line.Split(); Combination<String> c = new Combination<string>(parts, 2); foreach (String[] … |
The End.