¡@

Home 

c# Programming Glossary: edit

Parse JSON in C#

http://stackoverflow.com/questions/1212344/parse-json-in-c-sharp

the Google AJAX Search API and print it out to the screen EDIT ALL FIXED All results are working fine. Thank you again Dreas..

Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on

http://stackoverflow.com/questions/142003/cross-thread-operation-not-valid-control-accessed-from-a-thread-other-than-the

winforms invoke share improve this question EDIT As per SilverHorse's update comment the solution you want then..

Run Command Prompt Commands

http://stackoverflow.com/questions/1469764/run-command-prompt-commands

System.Diagnostics.Process.Start CMD.exe strCmdText EDIT This is to hide the cmd window. System.Diagnostics.Process process..

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

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

this but I would like to control the output formats. EDIT I am still looking at these to see the best alternative for..

Simple 2 way encryption for C#

http://stackoverflow.com/questions/165808/simple-2-way-encryption-for-c-sharp

have to worry about any external dependencies. Pre emptive EDIT I really don't want to have to mess around with public private..

Encrypt/Decrypt string in .NET

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

mono cryptography share improve this question EDIT 2013 Oct Although I've edited this answer over time to address.. Class documentation and the MCTS Training Kit . EDIT 2012 April This answer was edited to pre pend the IV per jbtule's..

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

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

you can see in Windows explorer. Any ideas how to do this EDIT I'll mainly be reading writing to video files AVI DIVX ... ..

Creating a byte array from a stream

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

0 ms.Write buffer 0 read return ms.ToArray EDIT I should perhaps explain why my answer is longer than the others...

How to use reflection to call generic Method?

http://stackoverflow.com/questions/232535/how-to-use-reflection-to-call-generic-method

method.MakeGenericMethod myType generic.Invoke this null EDIT For a static method pass null as the first argument to Invoke..

Deserialize JSON into C# dynamic object?

http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object

I'm interested in any discussion about this approach. EDIT I updated the code to fix a small bug with lists of complex.. want them as they aren't required for deserialisation. EDIT 2 If you are happy to have a dependency upon the System.Web.Helpers.. this DLL then the above approach is a good alternative. EDIT 3 Extension to support indexing into objects using string keys...

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

do separate hard coding for each variable width encoding. EDIT This has been somewhat tested but that's not to say it doesn't..

Casting vs using the 'as' keyword in the CLR

http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr

having thought of using a nullable type and as together EDIT Note that none of the above talks about performance other than..

How would you count occurrences of a string within a string?

http://stackoverflow.com/questions/541954/how-would-you-count-occurrences-of-a-string-within-a-string

takers I don't really want to dig out RegEx for this do I EDIT I I know my string is going to have the term I'm searching for.. have the term I'm searching for so you can assume that... EDIT II Of course for strings where length 1 string haystack once..

Anyone know a good workaround for the lack of an enum generic constraint?

http://stackoverflow.com/questions/7244/anyone-know-a-good-workaround-for-the-lack-of-an-enum-generic-constraint

c# .net enums flags share improve this question EDIT This is now live in version 0.0.0.2 of UnconstrainedMelody... library up to a usable standard quickly then relax a bit. EDIT I'm not sure about IsSet as a name by the way. Options Includes..

Create Generic method constraining T to an Enum

http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum

which forces the ugly boxing requirement to your code. EDIT All suggestions below have been greatly appreciated thanks...

How to get my own IP address in C#?

http://stackoverflow.com/questions/1069103/how-to-get-my-own-ip-address-in-c

to iterate the collection of them to find the proper one. Edit The only thing I would change would be to change this if ip.AddressFamily.ToString..

Parse JSON in C#

http://stackoverflow.com/questions/1212344/parse-json-in-c-sharp

I require the results ready to print out to the screen Edit Json.NET works using the same JSON and classes as the example.. ms obj return Encoding.Default.GetString ms.ToArray Edit If you want to use Json.NET here are the equivalent Serialize..

Elevating process privilege programatically?

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

with elevated permissions without additional prompting. Edit I see just just edited your question to state that runas didn't..

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

that can be perfectly adapted to your needs. WPF rules. Edit Second version this time much more similar to your original.. and Commands in the Node class and bind them to that. Edit2 Updated download link with a much nicer version. share improve..

How to convert UNIX timestamp to DateTime and vice versa?

http://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa

http blogs.msdn.com brada archive 2004 03 20 93332.aspx Edit This is what I've got so far public Double CreatedEpoch get..

Randomize a List<T> in C#

http://stackoverflow.com/questions/273313/randomize-a-listt-in-c-sharp

2010 02 when random is too consistent.html Edit Since writing this answer a couple years back many people have..

How do you convert Byte Array to Hexadecimal String, and vice versa?

http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa

bytes i 2 Convert.ToByte hex.Substring i 2 16 return bytes Edit you can improve performance for long strings by using a single..

Parsing JSON using Json.net

http://stackoverflow.com/questions/401756/parsing-json-using-json-net

new JavaScriptSerializer Foo foo ser.Deserialize Foo json Edit Json.NET works using the same JSON and classes. Foo foo JsonConvert.DeserializeObject..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

object source lambda return IOrderedQueryable T result Edit it gets more fun if you want to mix that with dynamic although..

How can I read the properties of a C# class dynamically?

http://stackoverflow.com/questions/4629/how-can-i-read-the-properties-of-a-c-sharp-class-dynamically

with Javascript. Is there any way to do this with C# Edit Oh and I am using C# 2.0 c# reflection properties share improve.. expressions it might be that other alternatives exists. Edit Well that teaches me to read the questions thoroughly first...

VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows

http://stackoverflow.com/questions/4933958/vs2010-does-not-show-unhandled-exception-message-in-a-winforms-application-on-a

Platform target to AnyCPU. The unfortunately disables Edit Continue and might not always be possible when you have a dependency..

Difference between Property and Field in C# 3.0+

http://stackoverflow.com/questions/653536/difference-between-property-and-field-in-c-sharp-3-0

between the above declaration and public string myString Edit I probably didn't explain what I meant very well. Once i know.. lot easier. Plus they show up differently in Intellisense Edit Update for OPs updated question if you want to ignore the other..

Random number generator only generating one random number

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

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

What does the [Flags] Enum Attribute mean in C#?

http://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c

Anyone have a good explanation or example they could post Edit I changed the answer this one is more in depth. c# enums flags..

Is there a way to check if a file is in use?

http://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use

stream null stream.Close file is not locked return false Edit Please check all the solutions here. Some of them are great..

ExecuteReader requires an open and available Connection. The connection's current state is Connecting

http://stackoverflow.com/questions/9705637/executereader-requires-an-open-and-available-connection-the-connections-curren

May I know what might have gone wrong and how do I fix it Edit Not to forget my connection string and connection are both in.. why i commented to trash it. That's only a problem source. Edit Here's a possible implementation of your retrievePromotion method..

Most elegant way to generate prime numbers

http://stackoverflow.com/questions/1042902/most-elegant-way-to-generate-prime-numbers

int n This function generates the first n primes edit where n 1 so generatePrimes 5 will return an ArrayList with..

How to dynamically create generic C# object using reflection?

http://stackoverflow.com/questions/1151464/how-to-dynamically-create-generic-c-sharp-object-using-reflection

typeArgs object o Activator.CreateInstance makeme Per your edit For that case you can do this ... var d1 Type.GetType GenericTest.TaskA`1..

Complex UI inside ListBoxItem

http://stackoverflow.com/questions/15532639/complex-ui-inside-listboxitem

item or a complex Master Detail template with Save and edit Buttons 8 Does winforms provide a consistent and adequate Document.. item or a complex Master Detail template with Save and edit Buttons This is simplifying...but a ListView is simply a ListBox..

Calculate the number of business days between two dates?

http://stackoverflow.com/questions/1617049/calculate-the-number-of-business-days-between-two-dates

answer There is little bug though. I take the freedom to edit this answer since the answerer is absent since 2009. The code..

Can you call Directory.GetFiles() with multiple filters?

http://stackoverflow.com/questions/163162/can-you-call-directory-getfiles-with-multiple-filters

.Where s s.EndsWith .mp3 s.EndsWith .jpg edit Please read the comments. The improvement that Paul Farry suggests..

C# member variable initialization; best practice?

http://stackoverflow.com/questions/298183/c-sharp-member-variable-initialization-best-practice

ctors like public Bar this public Bar string foo Foo foo edit as a side comment note that in the above if there are other..

Will using 'var' affect performance?

http://stackoverflow.com/questions/356846/will-using-var-affect-performance

on the performance of the code if it was used everywhere edit Previous question is here . c# performance share improve..

Good or bad practice for Dialogs in wpf with MVVM?

http://stackoverflow.com/questions/3801681/good-or-bad-practice-for-dialogs-in-wpf-with-mvvm

with MVVM I lately had the problem of creating add and edit dialogs for my wpf app. All I want to do in my code was something..

How to embed a text file in a .NET assembly?

http://stackoverflow.com/questions/433171/how-to-embed-a-text-file-in-a-net-assembly

the above description please leave a comment and I'll edit it until it is complete or makes sense share improve this answer..

How can I create a Product Key for my C# App

http://stackoverflow.com/questions/453030/how-can-i-create-a-product-key-for-my-c-sharp-app

to deal with users who have forgotten their key etc. edit I just want to add don't invest too much time in this or think..

Facebook/ Twitter with dotnetopenauth? [closed]

http://stackoverflow.com/questions/4821747/facebook-twitter-with-dotnetopenauth

up the web.config file for the OAuthClient project. Next edit the following settings Facebook sign up http developers.facebook.com..

Creating a blocking Queue<T> in .NET?

http://stackoverflow.com/questions/530211/creating-a-blocking-queuet-in-net

any blocked enqueue Monitor.PulseAll queue return item edit In reality you'd want a way to close the queue so that readers..

Proper use of the IDisposable interface

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

used by MyCollection any faster than it normally would edit So far people have posted some good examples of using IDisposable..

How can I insert an image into a RichTextBox?

http://stackoverflow.com/questions/542850/how-can-i-insert-an-image-into-a-richtextbox

see the results on the left hand side. You can of course edit the codes as you like which makes it quite convenient for testing..

Convert generic List/Enumerable to DataTable?

http://stackoverflow.com/questions/564366/convert-generic-list-enumerable-to-datatable

by enabling HyperDescriptor for the object type T . edit re performance query here's a test rig with results Vanilla..

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

.Use orderService orderService.PlaceOrder request edit per comments Since Use returns void the easiest way to handle..

View/edit ID3 data for MP3 files

http://stackoverflow.com/questions/68283/view-edit-id3-data-for-mp3-files

edit ID3 data for MP3 files What's a quick and easy way to view.. for MP3 files What's a quick and easy way to view and edit ID3 tags artist album etc. using C# c# .net mp3 id3 share..

C# How can I check if a URL exists/is valid?

http://stackoverflow.com/questions/924679/c-sharp-how-can-i-check-if-a-url-exists-is-valid

question You could issue a HEAD request rather than a GET edit lol Looks like I've done this before changed to wiki to avoid..