¡@

Home 

c# Programming Glossary: see

Public Fields versus Automatic Properties

http://stackoverflow.com/questions/1180860/public-fields-versus-automatic-properties

and used public fields. Then along comes C# 3.0 and I see they added automatic properties public class Book public string..

Elevating process privilege programatically?

http://stackoverflow.com/questions/133379/elevating-process-privilege-programatically

I also tried setting startInfo.Verb runas it didn't seem to solve the problem. c# .net windows process elevation .. elevated permissions without additional prompting. Edit I see just just edited your question to state that runas didn't work..

Create Excel (.XLS and .XLSX) file from C# [closed]

http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp

the output formats. EDIT I am still looking at these to see the best alternative for my solution. Interop will work but.. DataTables to easily work with Excel data. ExcelLibrary seems to still only work for the older Excel format .xls files but.. with each library as noted in the comments. In all EPPlus seems to be the best choice as time goes on. It seems to be more..

How to create and connect custom user buttons/controls with lines using windows forms

http://stackoverflow.com/questions/15819318/how-to-create-and-connect-custom-user-buttons-controls-with-lines-using-windows

the equation. These are the little red semi circles you see around the nodes which are actually what the Connector s are..

Encrypt/Decrypt string in .NET

http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net

this answer over time to address shortcomings please see jbtule's answer for a more robust informed solution. http stackoverflow.com..

Which .NET Dependency Injection frameworks are worth looking into? [closed]

http://stackoverflow.com/questions/21288/which-net-dependency-injection-frameworks-are-worth-looking-into

of Ninject screencasts by Justin Etheredge. I also can't see that retro fitting Ninject into existing above average code..

Read/Write 'Extended' file properties (C#)

http://stackoverflow.com/questions/220097/read-write-extended-file-properties-c

Comment Bit Rate Date Accessed Category etc that you can see in Windows explorer. Any ideas how to do this EDIT I'll mainly..

Tips for optimizing C#/.NET programs [closed]

http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs

for optimizing C# .NET programs closed It seems like optimization is a lost art these days. Wasn't there a.. string2.ToLower The general consensus so far seems to be measuring is key. This kind of misses the point measuring.. that there's some common pitfalls to look out for. I can see though that it might be useful to also know why a tip is useful..

Why does one often see “null != variable” instead of “variable != null” in C#?

http://stackoverflow.com/questions/271561/why-does-one-often-see-null-variable-instead-of-variable-null-in-c

does one often see &ldquo null variable&rdquo instead of &ldquo variable null&rdquo.. type of x 5 is Int32 not Boolean . I suggest that if you see this in your colleagues' code you educate them in the ways of..

Why is it important to override GetHashCode when Equals method is overridden?

http://stackoverflow.com/questions/371328/why-is-it-important-to-override-gethashcode-when-equals-method-is-overridden

the same this is a collision and Equals will be called to see if it is a real equality or not. In this case it looks like..

Best practice to save application settings in a Windows Forms Application

http://stackoverflow.com/questions/453161/best-practice-to-save-application-settings-in-a-windows-forms-application

file I read that the .NET configuration file is not foreseen for saving values back to it. As for the registry I would like.. file to save configuration settings If so I would like to see code example of that C# . I have seen other discussions on this.. If so I would like to see code example of that C# . I have seen other discussions on this subject but it is still not clear..

When to use struct in C#?

http://stackoverflow.com/questions/521298/when-to-use-struct-in-c

structs private struct Entry Tkey TValue use Reflector to see the code Serializable StructLayout LayoutKind.Sequential public.. IDictionaryEnumerator IEnumerator use Reflector to see the code The 'JonnyCantCode.com' source got 3 out of 4 quite.. a reference type IEnumerator is returned. What we don't see here is any attempt or proof of requirement to keep structs..

Proper use of the IDisposable interface

http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

database connections sockets window handles etc. But I've seen code where the Dispose method is implemented to free managed.. method is implemented to free managed resources which seems redundant to me since the garbage collector should take care.. bug Keep reading But there's a bug in that code. You see the garbage collector runs on a background thread you don't..

What is the best workaround for the WCF client `using` block issue?

http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue

share improve this question Actually although I blogged see Luke's answer I think this see alternative link is better than.. Actually although I blogged see Luke's answer I think this see alternative link is better than my IDisposable wrapper. Typical..

What is differences between Multidimensional array and Array of Arrays in C#?

http://stackoverflow.com/questions/597720/what-is-differences-between-multidimensional-array-and-array-of-arrays-in-c

inspect compiled assembly with IL disassembler you will see that storage and retrieval from jagged or single dimensional..

Random number generator only generating one random number

http://stackoverflow.com/questions/767999/random-number-generator-only-generating-one-random-number

lock syncLock synchronize return random.Next min max Edit see comments why do we need a lock here Basically Next is going..

Design - Where should objects be registered when using Windsor

http://stackoverflow.com/questions/1410719/design-where-should-objects-be-registered-when-using-windsor

within installers types implementing IWindsorInstaller See the documentation for more details share improve this answer..

C# Interfaces. Implicit implementation versus Explicit implementation

http://stackoverflow.com/questions/143405/c-sharp-interfaces-implicit-implementation-versus-explicit-implementation

reasons to use it not use it that others will post EIT See the next post in this thread for excellent reasoning behind..

Fast fourier transform in c#

http://stackoverflow.com/questions/170394/fast-fourier-transform-in-c-sharp

open source library with Fast Fourier Transform support. See ComplexImage.cs for implemenation http code.google.com p aforge..

What NoSQL solutions are out there for .NET? [closed]

http://stackoverflow.com/questions/1777103/what-nosql-solutions-are-out-there-for-net

docs redis client designing nosql database See the source code of Redis StackOverflow for another example of..

Embedding DLLs in a compiled executable

http://stackoverflow.com/questions/189549/embedding-dlls-in-a-compiled-executable

. For native DLLs you'll have a bit more work to do. See also How can a C windows dll be merged into a C# application..

Dependency Inject (DI) “friendly” library

http://stackoverflow.com/questions/2045904/dependency-inject-di-friendly-library

the dependency based on a value known only at run time. See this for more information. Compose only at the Last Responsible..

Creating a byte array from a stream

http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream

for closing the stream the caller should do that. See this article for more info and an alternative implementation..

Access to Modified Closure

http://stackoverflow.com/questions/235455/access-to-modified-closure

as a potential trap but in this case it doesn't hurt you. See the bottom of this page for a more complex example where the..

Windows service and timer

http://stackoverflow.com/questions/246697/windows-service-and-timer

garbage collection to occur before the method ends. See end of method. System.Timers.Timer aTimer Create a timer with..

Tips for optimizing C#/.NET programs [closed]

http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs

many strings together use StringBuilder instead. See link at the bottom for caveats on this. Use string.Compare to..

C# Captured Variable In Loop

http://stackoverflow.com/questions/271440/c-sharp-captured-variable-in-loop

string x in foo And again despite how it reads out loud See section 7.14.4.2 of the C# 3.0 spec for more details of this..

Is DateTime.Now the best way to measure a function's performance?

http://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance

such. DateTime.UtcNow typically has a resolution of 15 ms. See John Chapman's blog post about DateTime.Now precision for a..

ASP.NET MVC $.post call returning string…need help with format for jqGrid

http://stackoverflow.com/questions/4101116/asp-net-mvc-post-call-returning-string-need-help-with-format-for-jqgrid

like this value ID One ID Two ID Three ID Four ID Five See how there are two sets of quotes. This is probably because when..

What do two question marks together mean in C#?

http://stackoverflow.com/questions/446835/what-do-two-question-marks-together-mean-in-c

operator and quite like the ternary immediate if operator. See also Operator MSDN . FormsAuth formsAuth new FormsAuthenticationWrapper..

How to read a text file reversely with iterator in C#

http://stackoverflow.com/questions/452902/how-to-read-a-text-file-reversely-with-iterator-in-c-sharp

clear or the second bit set are the start of a character See http www.cl.cam.ac.uk ~mgk25 unicode.html characterStartDetector.. GetEnumerator Stream stream streamSource if stream.CanSeek stream.Dispose throw new NotSupportedException Unable to..

How to handle WndProc messages in WPF?

http://stackoverflow.com/questions/624367/how-to-handle-wndproc-messages-in-wpf

possible in WPF using HwndSource and HwndSourceHook . See this thread on MSDN as an example. The code posted works fine..

How check if given string is legal (allowed) file name under Windows?

http://stackoverflow.com/questions/62771/how-check-if-given-string-is-legal-allowed-file-name-under-windows

us library system.io.path.getinvalidfilenamechars.aspx UPD See Steve Cooper's suggestion on how to use these in a regular expression...

Calculate date from week number

http://stackoverflow.com/questions/662379/calculate-date-from-week-number

Calendar rules. It does not promise ISO8601 conformance. See some of the other answers here when you need that. Week numbering..

POCO vs DTO

http://stackoverflow.com/questions/725348/poco-vs-dto

purpose is to transfer state and should have no behavior. See Martin Fowler's explanation of a DTO for an example of the use..

String vs. StringBuilder

http://stackoverflow.com/questions/73883/string-vs-stringbuilder

question Yes the performance difference is significant. See the KB article How to improve string concatenation performance..