Answer Questions
Baji Prasad Convert Windows Application to Windows Service
Hi! I have Multithreaded Windows application having two windows for its GUI. I am trying to convert this Windows Application as it to Windows Service. While Starting windows service it gives me message that "The servcie did not respond to start ot control request in timely fashion". Can anyone help me out regarding this Thanking You in anticipation. Regards, Manish Hi Windows services inherit from the ServiceBaseClass http://msdn2.microsoft.com/en-US/library/system.serviceprocess.servicebase.aspx you need to: Any useful service overrides the OnStart and OnStop methods. For additional functionality, you can override OnPause and OnContinue with specific behavior in response to ...Show All
gafferuk what is the difference between .cer/.spc and .pvk/pfx?
Hello, I'm trying to figure out what is the difference between this keys. regards, can anybody help on this .cer - states for Certificate used for storing X.509 sertificate. This certificate contains informations about certificate owner, and also public and private certificate key. .spc - states for Software Publisher Certificate. This is just different representation of certificate in PKCS #7 format. You can generate spc file from cer file. .pvk - states for private key and is a private key from sertificate. you can extract the private key from certificate .cer file. Also you can create a certificate based on .pvk private key file. also file extension used with prevou ...Show All
MaceWindu merging multiple files into 1
Hi, I made an arraylist and put there 10 txt files. And i got 10 checkboxes. I want to bind the checkboxes (which are also in an array type of CheckBox) with the corresponding index of the arraylist. And after that i want to merge all the files into one file. This is the code: private CheckBox[] checkBox = new CheckBox[10]; public void Method() { ArrayList fileArray = new ArrayList(); string file1 = File.ReadAllText("file1.txt"); string file2 = File.ReadAllText("file2.txt"); string file3 = File.ReadAllText("file3.txt"); string file4 = File.ReadAllText("file4.txt"); string file5 = File.ReadAllText("file5.txt"); string file6 = File.ReadAllText("file6.txt"); string file7 = File.ReadA ...Show All
Philipp Lamp Form related question
Dear All Could you tell me that how to make the parentForm.cs placeholder of the childForm.cs, instead of making dialog or MDI, show me any alternative. Please Have a look on my reply there! I hope this will solve your problem! Best Regards, Dear Rizwan Please browse following http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=910677&SiteID=1 Can you explain a bit that what you mean by place holder here What you are trying to achieve Best Regards, ...Show All
StephanieR Compare ArrayList
Hello, I have 2 sorted array lists. e.g. arrayList1 = a,b,c,d,e,f,h,k,l and arrayList2 = a,c,d,f,g,h,i,j ArrayList1 contains the list of strings that are to be compared against. Unfortunately there are thousands of strings in each. So I don't know if it would be any good doing something like; does arrayList[0] == arrayList[0]||arrayList[1]||.... (in a loop of course). Another thing, arrayList2 is getting its (distinct) data from a database so I can't really check it against arrayList1 there and then, as it would leave the connection open for longer... I don't know maybe this is an ok trade off I don't suppose there is an efficient arrayList1.compare(arrayList2) method out there ...Show All
FrankGroves Copying a content of ArrayList to another ArrayList
Hi I have an ArrayList. I want to copy the members of the ArrayList to another ArrayList in the Ctr of a certain class. The thing is, when I copy the content of the first ArrayList to the second one, every change that I make in a member from the second ArrayList also changes in the first ArrayList. How can copy the content of the ArrayList to a different ArrayList so each of them will be independent Or is there a better way to do that The Clone() method should return a new object with all properties of the cloned instance - therefore it might be necessary to implement the method in every child class again ... Greets hi please check if your method is as follows public abstract ...Show All
Marek Istvanek How to understand the code
Hi, I am very new to the visual C# express and I need help. I am completely lost on understanding the code and what it means. For the example I followed I put the code in "Private void" and I have no idea what this means. can any one point me in the right direction or have a good tutorial I can follow. Hi, void means that the method does not return a value, for example if you want to print something to a console window you might have a function like: void Print(string text) { Console.WriteLine(text); } However sometimes you want a value to be returned from a method i.e. double CalculateTax(double amountEarned) { return amountEarned * 0.3; } The & ...Show All
Harry Solsem No clue about arrays, everything fails ...
I want to fill an array in the constructor of my object, and then use it in in another method. But no matter what I try, I can't get this right. It is too different from how arrays used to be. Either it does not compile, or the array remains null as in the example below. How should I do it class Calendar { private static int day,month; private static int [] daysPerMonth; public Calendar() { day=16; daysPerMonth[1] = 31; daysPerMonth[2] = 28; daysPerMonth[3] = 31; // does not work, daysPerMonth remains null // ... } public static AddDay() { day++; if (day>daysPerMonth[month]) {month++; day=1;} // ... } Regards, Guido Not in C#. It would in C++. ...Show All
Nonu_k Visual Studio 2005 TS crashes under Windows Vista Ultimate
Dear sir or madam, I am in urge of assistance regarding my VS2005 TS / VS2005 SP1 TS on Vista. I started by sumiting my problem to MS Connect, but they totally ignored me, and that why I hope to get help here. For the original request, please visit this URL: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=243085 My problem is severe - if i open any file in the VS IDE (except for CSS files) VS2005 crashes - and I mean crashes! I am left with the option to send a error repor to MS, which i usually do (and the crash must be big, as the processing time making the report takes close to 10 min. and the transfer as well take 10-15 min (upstream: 1024KB)). I have never had a problem like this under X ...Show All
SPECIALK_BC Generics: List vs Collection
Ok so I'm working with a generic collection and realize I need to sort. Track down the generic List (which I didn't know about). So this leads me to 'why is there a list and a collection' Is one lighter weight When should you use one vs the other Thanks! Nick H Hi, This thread is on the topic: http://forums.asp.net/thread/1511096.aspx And you can compare Collection and List with their members. Thanks Theoretically, a list is an ordered collection. A collection has no order. A list is a collection, and the IList and IDictionary interfaces extend ICollection. ...Show All
helen369331 Parsing from scientific notation
Hi Im trying to read in values from a file containing numbers that are a mix of "normal" doubles (i.e. 3.23124) and numbers written in scientific notation (i.e. -12e3). I guess this has something to do with the format of the string. Im trying to feed the values into a custum struct called Matrix, which takes doubles... The code I'm using is: if (numberOfRows>0 && numberOfColumns>0) { Matrix M = new Matrix (numberOfRows,numberOfColumns); fs.Position = 0; int i=0; while ((line = reader.ReadLine()) != null ) { string [] split = line.Split( new Char [] { ' ' }); for ( int j =0; j<split.Length; j++) M[i,j]= Double .Parse(split[ i ]); i++; } fs.Close(); r ...Show All
su45937 How can I right align a progress bar placed on a status bar?
Hello, I'm using .NET 2.0. As you know it's possible to add progress bar to the status bar. I'm wondering how it's possible to make the progress bar aligned to the right of the status bar, just like FireFox progress bar. Please advise. Thank you. awesome, thank you! maguidhir, add three labels to the status strip. Select the middle one and set its Spring property to True and empty the Text property (set to empty string). The middle label will stretch, filling all available space and pushing the right label to the far right... Andrej Change Progress control Alignment property to Right. ... and set StatusStrip's LayoutStyle to HorizontalStackWithOverflow. A ...Show All
Alex.Zealot Stopping a memory leak
I am using a third-party .dll in my C# application. I have built a wrapper class for it, and I have been successful in accessing the external methods. However, when I use this .dll, I am generating large numbers of handles which are not getting picked up and disposed of by the Garbage Collector. The calls to the external methods do not return handles to me. Does the call to an external method generate a handle implicitly If so, can I get access to it How can I get rid of these handles The garbage collector knows nothing of handles and memory allocations in native DLLs. You have to clean up those objects the old-fashioned way. See MSDN's notes about the IDisposable interface for the general desig ...Show All
baga Beware my nasty code! - how can I simplify this?
Hi have the following switch statement that tests for a value and then loads up its relating Form. switch (objQuestion.m_objQuestionType.m_strCustomForm) { case "FormInspectionAnswerCustomLocation": frm = new FormInspectionAnswerCustomLocation(ref objQuestion); break; case "FormInspectionAnswerCustomCause": frm = new FormInspectionAnswerCustomCause(ref objQuestion); break; case "FormInspectionAnswerCustomProduct": frm = new FormInspectionAnswerCustomProduct(ref objQuestion); break; case "FormInspectionAnswerCustomSupplier": frm = new FormInspectionAnswerCustomSupplier(re ...Show All
Sandy Place Redirecting STDOUT and STDERR from a DLL call
I have a C# program making a call to a C++ DLL file that is sending multiple outputs to the STDOUT and STDERR. Can anyone tell me an effective way to read the outputs from these streams. Chris ...Show All
