Are global static classes and methods bad?
It's generally agreed upon that relying heavily on global stuff is to be avoided. Wouldn't using static classes and methods be the same thing? ...
It's generally agreed upon that relying heavily on global stuff is to be avoided. Wouldn't using static classes and methods be the same thing? ...
I often have to create software to run tests (on hardware or other software), but I don't know of a good user interface control in .NET for displaying test results. (Just to clarify, I am not looking for a testing solution for .NET code. I am looking for a way to provide a system similar to those used for testing code to a user so that ...
Hi everyone, I'm trying to zip up the artifacts of a rake build, using Albacore's ZipTask. The solution I'm building has three projects that have artifacts that need to be zipped up individually, but only the ASP.NET MVC project will be mentioned here. Here's the directory structure of the solution: rakefile.rb solution.sln src/ (...
I have a list of objects. I need all possible permutations of those objects. In C++, there's std::next_permutation(). I have been trying to find something in the .NET Framework, but came up dry. What am I missing? ...
Currently I know of two methods of embedding assemblies into one application file: ILMerge and using the ResolveAssembly event. I would like to know if anyone have had more success with one over the other. Is there any drawbacks from using either one of those (performance, security, ...)? From my point of view, it looks like we should...
I have a string of values, and I want to simulate key press events in a window for each character. I plan on sending WM_KEYDOWN, WM_CHAR, and WM_KEYUP events to the window (as that is what seems to happen whan a key is manually pressed). Those messages require an int be sent in the wParam based on a table of virtual key codes. I can l...
I have the code below. The line string content = twitterMsg.text; is creating the error 'Use of unassigned local variable' for twitterMsg. I don't seem able to access my TwitterSearchResponse.results.text fields in my DataContractJsonSerializer<TwitterMain> collection. TwitterSearchResponse.results is an array (set of object propertie...
I have two programs which are accessing a directory using the .NET Directory class static methods. The first program is only reading a directory, while the second is attempting to rename a directory. The directory being renamed by the second program may not be the same directory that is being read by the first program. When the second...
I have byte arrays that can be a few dozen megabytes in size. Such large arrays are not happy creatures, especially when you have a many of them. So I would like to compress them, so they're easier to deal with. They compress well, generally a 3:1 ratio with DotNetZip set to BestSpeed. The data in the arrays can be nearly identical. ...
I am having to interface some C# code with SQL Server and I want to have exactly as much precision when storing a value in the database as I do with my C# code. I use one of .NET's decimal type for a value. What datatype/precision would I use for this value in SQL Server? I am aware that the SQL Server decimal type is the type that mo...
I want to be able to initialize a class just like I initialize a string: string str = "hello"; MyClass class = "hello"; I really don't know what exactly string str = "hello"; does. I assume "hello" gets translated by the compiler into new System.String("hello"); but I'm not sure. Maybe is just not possible or maybe I'm missing somethi...
I need to get 1000's of XML files stored in a sql server database through a .Net web service for a call from iPhone? Please suggest a better way to handle it in .net web service? ...
If a process loads both a .NET 1.1 COM object and a .NET 2.0 COM object, both using an in-process server, what happens? Does anything break with this configuration? Or would it be safer to make one of the objects an out-of-process server? ...
We have Object and ValueType.... And String.... String is derived from object, but it is immutable. Is it considered a type of it's own as it doesn't behave like other objects? Is it the only object that has this immutable behaviour? Is it the runtime, compiler or library that defines this? And are there other cases like this in .Net? ...
If I have a string such as "abcdef{123}ghi{456}kl", I want to create a regex that will give me all the parts separated as follows: abcdef {123} ghi {456} kl I am using this code, but can't figure out what the expression should be: System.Text.RegularExpressions.Regex rex = new System.Text.RegularExpressions.Regex("expression"); fore...
Hey, I am in the following situation: I have been requested to write an application for managing where we have customers - this must flag up when we try to add a customer too close to another one, so must be able to calculate distances based on post codes. I have chosen to use ASP.Net VB because I am fairly good at that and I like tha...
How does one animate a ProgressBar whose Value property is databound? <ProgressBar Height="25" Margin="5" Maximum="100" Value="{Binding CurrentProgress}"> My data source would probably "jump" from value to value, usually from user input; for example - user performs action, and the progress bar jumps 20 points. I would want to be able ...
Currently, we use a giant configuration object that is serialized to/from XML. This has worked fine for the most part, but we are finding that in the case of power loss and application crashes, that the file could be left in a state that renders it unable to deserialize properly, effectively corrupting the configuration information. I w...
i was wondering how to send spacebar key using SendKeys.send() ; it works with the other keys but onley the spacebar !! here is the link where i found the other keys http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx ...
Hi All, I am somewhat familiar with using configuration in .NET, but I am a little bit confused about something. You create an App.Config file to go with your exe, and any dlls you create use the same configuration file. So how do you access the config in the configuration file from within your DLL? If you create a settings.settings in...