Answer Questions
ringram2077 Properties.Settings; ArrayList and a custom object
Hello, I am writing a Windows Forms application using .NET Framework 2.0 and Visual Studio 2005. I would like to use Properties.Settings class to persist a collection of custom objects, so I can created a property called Connections of type System.Collections.ArrayList using the Properties designer in VS. At run-time I populate an arraylist with instances of my class and then I set the Connections property to this arraylist. Then, I execute the Save command on the Settings.Default. The Save command does not generate an error, but no settings are persisted either. Do I need to do something special with ArrayList and my class (serialization, perhaps) in order for settings to be persisted correctly Many thanks for your help! ...Show All
Sarah Cartwright FileLogTraceListener not writing to file beyond a constant max-size
Hi Friends, I've been using FileLogTraceListener class to write log data to files. Since the data being written is continuously generated, I set the file to be created on a daily basis. I do not set up the maximum size for the log file. The problem is - My log files do not seem to grow beyond a fixed size (4833 K). All messages are written to log file till the file grows to this size and then no logs are appended. Here are my settings - faultLoglistener = new FileLogTraceListener(); faultLoglistener.Location = LogFileLocation.Custom; faultLoglistener.CustomLocation = "C:\\"; faultLoglistener.BaseFileName = "FaultLog"; faultLoglistener.LogFileCreationSchedule = LogFileCreationScheduleOption.Daily; faultLogli ...Show All
Daniel Gil how to run a c# program visualstudio.net 2005 edition
Im new to .net technology.I have visualwebdevoper 2005 express edion .I dont know how to run c# programs using this edition.could anyone pls help me You need to download Visual C# express which is diferrent than visual web developer, you may be able to view C# source code with visual web developer but to debug an application you will need Visual C# Express. If you open Visual Studio 2005, select File -> New Project ->C# Project ->WindowsAppliation. This will change the environment automatically to C#. Else open an existing C# project, if you dunt have one there are many such lurking out on the Net. Pick up some temp and start modifying it. i hav vis ...Show All
Mapa3matuk Method Parameter Naming Style
Sometimes I have a method that initializes a class by passing in a few values. In this situation, I generally want to set the value of a private member from the parameter value passed in. (In other words, I don't want to "Set" the property and trigger code in the Set method.) So my code would look like this (** this obviously won't work.. hence, my question... *) public class MyClass{ int x; int y; public void Init( int x, int y ) { x = x; y = y; } I have read many suggestions on naming styles, but so far I haven't seen an example of the "right" way to handle this. I've played with different prefixes and other tricks to rename the method parameter, and of course any of them work , but I ...Show All
sczzmxzx Beginner question about method overloading!
Can someone please explain to me what a method overload actually is and maybe possibly give me a code example in C# for me to see I am looking to land an entry level dev job and need to know this question! Thank you! I try to summarize sth: Each member has a unique signature. Method signatures consist of the method name and a parameter list (the order and types of the method's arguments). More than one method with the same name can be defined within a type as long as the signatures differ. When two or more methods with the same name are defined, the method is said to be overloaded. Parameter lists can be qualified by the varargs constraint, which indicates that the method supports a variable argument l ...Show All
MarcoB Setup projects: "variables" in registry values?
My question is probably best posed as a scenario: During install, I want to add a registry string that contains the full path of where I was installed to. For example, if the user elects to install to "c:\program files\MyProg", then as part of the setup process I want to add a registry value under HKLM\Software\<my app>\InstallPath = "c:\program files\MyProg". It *looks* as though the VS 2005 Setup project only allows "fixed" values added to the registry. I'm hoping I'm wrong. Brad. Brad, Did you find a solution to this problem I want to do the exact same thing. I already tried [Application Folder] as the Value property and it did not seem to work. -Frank ...Show All
laboremus Build up a variable name with a string
Hi, I wonder if there's a way (in c#) to build up a variable name by the concatenation of two strings...For example int intTest = 1; string strTest = "strTest"; string strTest+intTest.toString() = "this is my new var"; Thanks in advance I don't think you can make a variable name based on what you enter in a string. I could be wrong but never seen this done before and when you try to do it like you have done, compiler will of course complain. >> Or in VFP: via macro substitutions-a very nice feature. Well.. that's debatable. I saw them a lot years ago when I was coding in Clipper (which, like FoxPro originally, was a dBase III compiler). I've never seen a good design that used ...Show All
donkaiser Unable to connect to database
Hello. I am developing my databaseapplication, and I work on the same server where SQLEXPRESS is installed. My prototyping was done on a lokaldatabase. Now I need to connect to the real database but i get errormessage when trying to connect with wizzard: Unable to open physical file: D:/program files........++ . Operating system error 32 (Error not found)An attempt to attach an autonamed database for file.....failed. .. Do you have any suggestion what to do Now I tried with SQL server 2005 and i got this error. the file \\810-......mdf is not on network path that is supported for database files.. I always thought that I can connect to my databaseserver and database from my application ...Show All
Henry Boehlert Unhandled exception only when running in release without debugger attached.
I am beyond baffled by this. My application throws a System.AccessViolationException only when it is run in Release mode without the debugger attached (as in, I run the exe directly, outside of Visual Studio or I do "Start Without Debugging" in the Debug menu). Debug mode - everything works great; Release mode with debugger attached - everything works great. The very nature of how this error is thrown makes it impossible to debug, so I have no idea where to look into correcting it. Has anyone else ever come across such an error Does anyone have an idea how to hunt down such an error The application is not just a few hundred lines, it is easily on the upper end of tens of thousands of lines. I cannot seek it out with a debugger be ...Show All
George2 Generic overloading badness
Hi I wrote a class that looked something like this: class Factory { void UpdateCache<T>(T object) { } void UpdateCache(IObjectList list) { } } I then used the methods on a variety of objects, including classes implementing IObjectList. This compiled without any warnings. However, the second version of the method (taking IObjectList) is only called if its parameter is explicitly cast to IObjectList. It's debatable whether this is the correct behaviour or not, but at the very least, shouldn't this raise a warning IMHO the least generic (or most specialized) method callable is the one that should be called. I can't immediately see a reason why this is difficult or impossible. ...Show All
Kiwi Ranger Process Module
Hi, I have an application which lists all the running processes of the machine and i need to get the full path from which the process is running. I am trying to use the following methods : Process.MainModule.Filename Process.MainModule.ModuleName The above code doesn't work it throws an exception "Unable to enumerate the process modules" any thoughts Regards Alan what about show it icon in the listbox I could be wrong but here is my understanding: I would lean towards agreeing with SvenC about the problem - that you are not able to access some processes due to the security at some level causing t ...Show All
mableu webclient and http status
Is there any access to the http status ( 200, 404, etc) and the text (OK, notfound, etc) in the webclient.uploadstring() method if there is a webexception caught then all the failure information you need would be here. Forutnately this method does throw just that - the webexception. http://msdn2.microsoft.com/en-us/library/system.net.webexception.aspx http://msdn2.microsoft.com/en-us/library/system.net.webexception.status.aspx you would look at the status of the exception which has enum values of the webexception (WebExceptionStatus) does this help ...Show All
Jademobile Can the (QoS/qWAVE) be used as a media tutorial?
I do not have Vista, but I am curious as to the limitations of (QoS/qWAVE) Would like to know if their is such a thing as creating a media file that loads at "first boot up" Then is available for the user to use as reference later on if need be Is this possible I am not even sure if I am in the right area to ask this question or not. This link was given to me in the MSNexpert live chat. I am having a hard time explaining this to you. So forgive my somewhat ignorance in this. I have, for a couple of months chatted with different departments in the live expert chat. Prioritizing The security aspects of Vista is a must. But I discussed them adding video files to the OS concerning Security measures they should take ...Show All
fafnir I cant get C# to perform a simple division!
The following code show the problem, I get 0 as a result when I expect 0.5 I would be very grateful for help from the community. Paulo C. namespace ConsoleApplication1 { class Program { static void Main( string [] args) { test t = new test (); List < double > list = new List < double >(); list.Add(3); list.Add(4); double r = t.computeIndex(list); Console .WriteLine(r); MessageBox .Show(r.ToString()); } class test { public test () {} public double computeIndex ( List < double > index) { return (1 / index.Count); } } } } The result is being rounded, if you try dividing 3/2 = 1.0 instead ...Show All
Michael_P2234 Send a String to another application
Ok I have a program that logs me into World of Warcraft at a specified amount of time, but to send the username and password I use the SendKeys.Send("string"), and I was just wondering if there was a better way to do this. Is there any way that I can get the text boxes handles and just pass them the values Awesome that is exactly what I wanted to know. I will mess around with that to see what I can come up with. Thank you for the help. If it's an actual window (not directx rendered) you can get the handle to the window using: Process p = Process.GetProcessesByName("wow.exe"); IntPtr hwnd = p.MainWindowHandle; You probably don't want th ...Show All
