- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 21
- Posts with Upvotes
- 16
- Upvoting Members
- 12
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: Note that the [icode]params[/icode] keyword is not required unless you are going to add individual ints as multiple parameters to the method. | |
Re: I think from what you have said you need to get the optimal price for the space/weight allowed a very interesting problem, this is a version of the multi-dimensional knapsack problem. See [URL="http://tracer.lcc.uma.es/problems/multi01knap/knap.htm"]here [/URL] for an in depth description of the problem. From the layout of this question I guess … | |
Re: If you are using an rich text edit just use the line breaks, most apps that compare and highlight changes in lines will highlight the actual change and the line number part of the display. In short I would just use the default action. | |
Re: Why do you need to create a builder app to do that? Could you not just use user configuration settings. (Properties.Settings in a forms app) | |
Re: Yep that should work just the same way as any other key. [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx"]Microsofts SendKeys Description [/URL] | |
Re: Have a look at this thread: [URL="http://social.msdn.microsoft.com/Forums/en-US/windowssecurity/thread/10c6ff4b-701b-4351-a3d8-a716d8831a66"]http://social.msdn.microsoft.com/Forums/en-US/windowssecurity/thread/10c6ff4b-701b-4351-a3d8-a716d8831a66[/URL] | |
Re: FYI: When creating graphics in a Windows Forms App by default you use GDI+. It's not normally called WFA hence ddanbe's confusion. You can look at using either WPF or DirectX depending on the requirements you have. googleing either will give alot of tutorials and furthur information. | |
Re: I think I see the problem: If you have a argument that is a string you would assign it like this [icode]string str = "'001', '002', '003'"; [/icode] now if you added that to your query like this [icode] string.format("Select * from ... where appName in {0};", str); [/icode] it … | |
Re: Have a look at the below, the System.Diagnostics.Process class. [CODE] Process[] processes = Process.GetProcesses(); ... Process p = Process.GetProcessesByName("aname"); p.Kill(); [/CODE] | |
Re: I don't think I quite understand what you are trying to achieve. If you want to access the same static methods/functions from a number of places the best way to do this is to create a class like this: [CODE] public class MyClass { public static bool MyMethod(float arg) { … | |
Re: Um ignore IceMans post as the example is in C/C++. To do this using a form is quite simple. In the properties of designer select the events tab and double click the gap next to KeyPress to create the event handler code for you. Now do somthing like below: [CODE] … | |
Re: In newer versions of .Net you can declare properties like this: [CODE] // For a simple property (this is useful because properties // are thread safe) public int MyInt{get; set;} // To allow it to only set with the current class but viewable outside public int MyInt{get; private set;} [/CODE] … | |
Re: You could use a standard for loop: [CODE] for(int index=0; index < hashtable.Keys.Count; index++) { switch(hashtable.Keys[index]) { ... } } [/CODE] | |
Re: Is this of any use to you? [URL="http://www.codeproject.com/KB/system/cstcpipwmi.aspx"]http://www.codeproject.com/KB/system/cstcpipwmi.aspx[/URL] | |
Re: It could be a threading issue or somthing similar. What happens when you step through it and have you tried using try and catch around the affected code? | |
Re: 1/. An IntPtr is a pointer to an int you can convert it easily to either int32 or int64 (int and long respectivly) see below: [CODE] int i = 10; IntPtr p = new IntPtr(i); int aInt = p.ToInt32(); long aLong = p.ToInt64(); [/CODE] 2/. All that code is doing … | |
Re: It's also worth noting that you can use the -= operator to stop the delegate pointing to a method e.g. [CODE] Car myCar = new Car(); public void Start() { myCar.Crash += new Car.CrashEventHandler(myMethod); } private void myMethod() { ... } public void Stop() { myCar.Crash -= new Car.CrashEventHandler(myMethod); } … | |
Re: I think the way to do this is to use a manifest file as explained [URL="http://www.enusbaum.com/blog/2007/08/26/how-to-run-your-c-application-as-administrator-in-windows-vista/"]here[/URL]. I think this will still prompt the user to click the run as admin popup though. | |
Re: Yep you really should use parameterised querys instead of directly inserting arguments into strings! See security issues regarding SQL injection etc. I tend to use somthing like this: [CODE] public DataSet Query(string sql, params SqlParameter[] args) { try { SqlConnection connection = new SqlConnection(this._connection); SqlCommand command = new SqlCommand(sql, connection); … | |
Re: 1/. You don't need a new method for every button just call the same method and do somthing like this: [CODE] private void btnLetter_Click(object sender, EventArgs e) { if (Pwdsel == 1) { insertStringPass((sender as Button).Text, this.Password.SelectionStart); } else { insertStringUser((sender as Button).Text, this.Username.SelectionStart); } } [/CODE] 2/. You should … | |
Re: If you are in the new item dialog you have gone too far. The 'Component...' option is in the add menu second from bottom. I am using VS 2008 | |
Re: I am not 100% sure what you actually want to know. If the time in the database is 'DateTime' or 'SmallDateTime' then no matter how you pass a date it will store it with hours mins and seconds. If you just pass a date then the database will contain a … | |
Re: You will still need the .Net framework for your executable to run on the target machine. If your executable references any other dlls then you will need to add those too. You need the .Net framework because the exe you have is not a set of machine code instructions that … | |
Re: You will need to call CreateChart() using a Chart object as an argument I presume that there is a Chart described in dotnetCHARTING.WinForms that you will need to use. I don't know what a Chart is so I can't be sure but I suspect you need to do somthing like … | |
Re: What you are looking for is a sorting algorithm, there are a few of these and they vary in complexity from the recursive Quicksort to a simple Bubble sort. This tutorial gives you code and a more in depth explaination:[URL="http://www.publicjoe.f9.co.uk/csharp/sort00.html"]http://www.publicjoe.f9.co.uk/csharp/sort00.html[/URL] | |
Re: If you did not force all the elements of an interface then what would happen when a missing element was called? (see below) [CODE] foreach(ITemp tmp in myCollection) { string name = tmp.GetName(); } [/CODE] | |
Re: What do you have so far? | |
Re: It's probabbly because you have a console app and Message is part of System.Windows.Forms eg not included in a console app by default. Even if you add the assembly reference I don't think the WndProc will work unless you have a form. | |
Re: Is the dll import expecting it to be in 'Windows\System32' or somthing similar? | |
I have a small WMI issue that I am having trouble with. I am using root\WMI:MSSerial but would like to retrieve properties from both MSSerial_PortName and MSSerial_CommInfo specifically the following properties PortName, IsBusy and Active. If I query just one object then the code below works fine but I can't … |