- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
32 Posted Topics
Re: [QUOTE=Rajnesh]I thing Microsoft Vista is designed in C#, isn't it?[/QUOTE] LOL | |
| |
Re: Hi, for padding you can use this: [code] string a = "123"; string b = String.Format("{0,-20}", a); [/code] b is of length 20, containing "123" (padded to the left) and the rest is filled with spaces Hope, this helped. | |
Re: Yes, because you must use the window handle of the Application: [code] theprocess.MainWindowHandle [/code] use that one... | |
Re: Here: [code] RegistryKey subKeys = HKCU.OpenSubKey("Software\\VB and VBA Program Settings\\Company\\", true); [/code] | |
Re: [QUOTE=JerryShaw;549396] The problem is the way you declare the out of class timer. The way it is defined, means it will run in its own thread. [/QUOTE] What?:D That timer is certainly NOT out of class. [QUOTE] Threads can not adjust non-thread safe components in other threads (like this main … | |
Re: Or just put that code into a try/catch block and output the error message or a custom message | |
Re: Here is corrected source: [code=C#] using System; using System.Collections; using System.ComponentModel; using System.Drawing; using System.Net; using System.Net.Sockets; using System.Reflection; using System.Security.Principal; using System.Text; using System.Threading; using System.Windows.Forms; namespace LanChat { public class LanChat : Form { public Button buttonAdvertise; public Button buttonSend; public Button buttonStop; public ComboBox comboBoxUserNames; public IContainer … | |
Re: There are overloads for that method, have a look here : [url]http://msdn2.microsoft.com/en-us/library/wcxyzt4d.aspx[/url] should be the one you need | |
Re: [QUOTE=fishsqzr;461940]From what I can tell, C# doesn't do that, at least by default. Is there a compiler directive or attribute which will allow that?[/QUOTE] So basically you think c# doesn't support short-circuit evaluation ? Have a look here: [url]http://msdn2.microsoft.com/en-us/library/2a723cdk(VS.71).aspx[/url] @iamthwee: Those kind of answers are not very helpful, altough they … ![]() | |
Re: Hi, i tried out your code and it seems to work even with the spaces, however one remark: i don't know if it was your intention to initialize the split variable inside the loop...so keep in mind that it will be overwritten all the time and just keeps the latest … | |
Re: Try this: [inlinecode] string[] lines = Regex.Split(s, "(.+?)(\\*{0,13}RECIVED MAIL)\\s*(PQR.+)(New PQR.+)(Respond.+)"); [/inlinecode] | |
Re: Hi, if every line starts with the date, this should do the trick: [code] List<string> lines = new List<string>(); using (StreamReader r = new StreamReader(new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\data.txt", FileMode.Open))) { string line; while ((line = r.ReadLine()) != null) { lines.Add(line); } } lines.Sort(); [/code] | |
Re: This is usually done with recursion: [code] void Fetch (string SourceString) { arrayCount = 0; DirectoryInfo di = new DirectoryInfo(SourceString); FileInfo[] rgFiles = di.GetFiles("*.mp3"); foreach (FileInfo fi in rgFiles) { fileIndex[arrayCount] = fi.FullName; MessageBox.Show(fileIndex[arrayCount]); // Temp for testing arrayCount++; } DirectoryInfo[] dirs = di.GetDirectories(); foreach (DirectoryInfo diNext in dirs) { … | |
Re: What i don't understand in your code is that you first format the DateTime to a string and then you construct another DateTime object from that same string; is that step absolutely necessary? By reading that small snippet you posted I can't see any obvious reason why one should do … | |
Re: Have a look at [URL="http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.openremotebasekey.aspx"]http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.openremotebasekey.aspx[/URL] | |
Re: You can do something like this: [code] if (st.ToLower().Contains(data.ToLower())) [/code] | |
Re: [url]http://msdn2.microsoft.com/en-us/library/ms180903(VS.80).aspx[/url] | |
Re: It's possible that your custom RandomNumberGen class is not seeded properly, where is the seed set? | |
Re: This is because you instantiate the stringbuilder object via [code] strbuild = new StringBuilder(); [/code] in the loop, you have to instantiate it outside when you first declare it [code] StreamReader reader = new StreamReader(@"d:\web_extract.txt",Encoding.Default); StringBuilder strbuild = new StringBuilder(); <--here [/code] | |
Re: [QUOTE=jerryodom;303488] [I]Error 1 The best overloaded method match for 'string.ToString(System.IFormatProvider)' has some invalid arguments[/I] [/quote] This is because you call ToString on type string instead of long. Make sure your code looks like this: [code] long num = 4445556666; string s = num.ToString("(###)-###-####"); [/code] | |
Re: [QUOTE] [COLOR=#008080]Console[/COLOR][COLOR=#000000].Read();[/COLOR] [/QUOTE] It's waiting for the user to press the ENTER key here, so it stops | |
Re: It would help us if you would paste use the complete source code, otherwise it's hard to recreate your problem (and eventually help you). | |
Re: have a look at that: [url]http://msdn2.microsoft.com/en-us/library/system.threading.waithandle.aspx[/url] | |
Re: I don't see where you actually declared your delegate ? somewhere in the namespace put this: [code] public delegate void ProcessingCompleteDelegate(); [/code] also to fire an event you usually do it like this: [code] if (SearchComplete != null) SearchComplete() [/code] that code would go in your Start() method | |
Re: What about having a look at Convert.ToBase64String and Convert.FromBase64String ? | |
Re: Hi, i don't know exactly what you want to do there, but if you want only to make your int array public by a property you could do this in your class: [code] public int[] MyArray { get { return myArray; } } [/code] Then when you want to call … | |
Re: try this solution: [code] bool SortBylength(const string& a, const string& b) { if (b.length() > a.length()) { return true; } return false; } int _tmain(int argc, _TCHAR* argv[]) { vector<string> v; for (int i = 0; i < 3; i++) { cout << "enter word " << i + 1 … | |
Re: [url]http://www.codeproject.com/csharp/highperformancetimercshar.asp[/url] | |
Re: [code] // generate exception catch (DivideByZeroException e) { // handle exception } [/code] | |
Re: well, to make registry access read only you could log into your windows without admin rights :P another thing maybe would be to store that data in a file and fiddle with the security rights of it (right click file -> choose security tab) and modify these to have some … | |
Re: Well, honestly i m MCSD.NET and it didn't help me that much getting a job. What they look for nowdaddays is a MS in computer science, wether you code or are at the helpdesk (sad but true). As for the the 70-315 preparation have a look here, it might help:[url]http://www.testking.com/70-315.htm[/url] … |
The End.