¡@

Home 

c# Programming Glossary: me

Parse JSON in C#

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

JSON in C# I'm trying to parse some JSON data from the Google AJAX Search API. I have this URL and.. genuine text output for my ASP.NET page so I've been recommended to give JSON.NET a try. Could anyone point me in the right.. recommended to give JSON.NET a try. Could anyone point me in the right direction to just simply writing some code that'll..

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

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

Excel to be on the machine you are using. Also the OLEDB method is intriguing but may not yield much more than what I can.. the 2003 xml format but that also puts a Excel 2003 requirement on the file. I am currently looking at a port of the PEAR.. of the PEAR PHP library Excel Writer that will allow some pretty good XLS data and formatting and it is in the Excel_97..

How to properly clean up Excel interop objects

http://stackoverflow.com/questions/158706/how-to-properly-clean-up-excel-interop-objects

the following code in my finally clause while System.Runtime.InteropServices.Marshal.ReleaseComObject excelSheet 0 excelSheet.. to COM objects. I guess you're invoking at least one member of a COM object without assigning it to a variable. For.. of a COM object without assigning it to a variable. For me it was the excelApp.Worksheets object which I directly used..

Encrypt/Decrypt string in .NET

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

Decrypt string in .NET Can someone give me the code to Encrypt and Decrypt a string in C# c#.. Decrypt string in .NET Can someone give me the code to Encrypt and Decrypt a string in C# c# .net encryption.. EDIT 2013 Oct Although I've edited this answer over time to address shortcomings please see jbtule's answer for a more..

When to Use Static Classes in C#

http://stackoverflow.com/questions/241339/when-to-use-static-classes-in-c-sharp

static class CompanyInfo public static string GetCompanyName return CompanyName public static string GetCompanyAddress return.. public static string GetCompanyName return CompanyName public static string GetCompanyAddress return CompanyAddress.. ... Use a static class as a unit of organization for methods not associated with particular objects. Also a static class..

Randomize a List<T> in C#

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

this question Shuffle any I List with an extension method based on the Fisher Yates shuffle public static void Shuffle.. The code above uses the much criticised System.Random method to select swap candidates. It's fast but not as random as.. this answer a couple years back many people have commented or written to me to point out the big silly flaw in my comparison...

Split List into Sublists with LINQ

http://stackoverflow.com/questions/419019/split-list-into-sublists-with-linq

way I can separe a List into several separate lists of SomeObject using the item index as the delimiter of each split Let.. using the item index as the delimiter of each split Let me exemplify I have a List SomeObject and I need a List List SomeObject.. delimiter of each split Let me exemplify I have a List SomeObject and I need a List List SomeObject or List SomeObject so..

Case insensitive 'Contains(string)'

http://stackoverflow.com/questions/444798/case-insensitive-containsstring

string There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both.. UPDATE The sillyness I refer to is the i18n issues that come with up and down casing. c# contains case insensitive share.. character 'Ä°'. Thus the strings tin and TIN are the same word in English but different words in Turkish . As I understand..

Protect .NET code from reverse engineering?

http://stackoverflow.com/questions/506282/protect-net-code-from-reverse-engineering

tampered with and how do I make sure that the registration mechanism can't be reverse engineered Also it is possible to convert.. enough to crack to make it not worth peoples' trouble. Some suggestions I have for you to help protect your application.. Obfuscate your code. Dotfuscator has a free edition and comes with Visual Studio. Use public private key or asymmetric encryption..

Proper use of the IDisposable interface

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

IDisposable interface I know from reading the MSDN documentation that the primary use of the IDisposable interface is.. interface is to clean up unmanaged resources. To me unmanaged means things like database connections sockets window.. is to clean up unmanaged resources. To me unmanaged means things like database connections sockets window handles etc...

How does one parse XML files? [closed]

http://stackoverflow.com/questions/55828/how-does-one-parse-xml-files

does one parse XML files closed The default methods for dealing with XML in C# seem incredibly crude to me.. for dealing with XML in C# seem incredibly crude to me leading me to suspect that I must be missing something in my.. dealing with XML in C# seem incredibly crude to me leading me to suspect that I must be missing something in my searches...

Deep cloning objects in C#

http://stackoverflow.com/questions/78536/deep-cloning-objects-in-c-sharp

cloning objects in C# I want to do something like myObject myObj GetmyObj Create and fill a new object.. copying each property individually but it always leaves me with the feeling that there is a better or more elegant way.. this question Whilst the standard practice is to implement the ICloneable interface described here so I won't regurgitate..

Using C# regular expressions to remove HTML tags [duplicate]

http://stackoverflow.com/questions/787932/using-c-sharp-regular-expressions-to-remove-html-tags

remove all HTML tags including the angle brackets Can someone please help me with the code c# html regex parsing share.. tags including the angle brackets Can someone please help me with the code c# html regex parsing share improve this question.. not use regular expressions to process XML or HTML documents. They do not perform very well with HTML and XML documents..

Is it possible to dynamically compile and execute C# code fragments?

http://stackoverflow.com/questions/826398/is-it-possible-to-dynamically-compile-and-execute-c-sharp-code-fragments

it possible to dynamically compile and execute C# code fragments I was wondering if it is possible to save C# code fragments.. I was wondering if it is possible to save C# code fragments to a text file or any input stream and then execute those.. execute those dynamically Assuming what is provided to me would compile fine within any Main block is it possible to compile..

How do I calculate someone's age in C#?

http://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c

do I calculate someone's age in C# Given a DateTime representing a person's birthday.. do I calculate someone's age in C# Given a DateTime representing a person's birthday how do I calculate their age.. birthday how do I calculate their age c# .net datetime share improve this question For some reason Jeff's code didn't..

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

share improve this question Sorry for only commenting in the first place but i'm posting almost every day a similar.. first place but i'm posting almost every day a similar comment since many people think that it would be smart to encapsulate.. smart to encapsulate ADO.NET functionality into a DB Class me too 10 years ago . Mostly they decide to use static shared objects..

Response.Redirect to new window

http://stackoverflow.com/questions/104601/response-redirect-to-new-window

like asp LinkButton ID myButton runat server Text Click Me OnClick myButton_Click OnClientClick aspnetForm.target '_blank'..

Event Signature in .NET — Using a Strong Typed 'Sender'?

http://stackoverflow.com/questions/1046016/event-signature-in-net-using-a-strong-typed-sender

SomeEventHandler Publisher sender PublisherEventArgs e MessageBox.Show StrongTypedSubscriber.SomeEventHandler called... void SomeEventHandler object sender PublisherEventArgs e MessageBox.Show TraditionalSubscriber.SomeEventHandler called... Public Sub OnSomeEvent RaiseEvent SomeEvent Me New PublisherEventArgs End Sub End Class Class StrongTypedSubscriber..

Install to same path when upgrading application

http://stackoverflow.com/questions/11474320/install-to-same-path-when-upgrading-application

this same path. Generally the only difference between Just Me and Everyone is the location of the shortcuts that are created... the condition as SEARCHFORINSTALLDIR Leave InstallUrl and Message Right click the Setup Project View File System Select Application..

How can I update a cell value in a dB table, using SQL Server CE and C# (Visual Studio 2010)

http://stackoverflow.com/questions/13235527/how-can-i-update-a-cell-value-in-a-db-table-using-sql-server-ce-and-c-sharp-vi

helpful. Are you using a connection string like c Users Me Visual Studio 2010 Projects MyProject bin debug HKRMoviesDB.sdf..

C# - remove text in between delimiters in a string - regex?

http://stackoverflow.com/questions/1359412/c-sharp-remove-text-in-between-delimiters-in-a-string-regex

match Given Results In Hello some World Hello World Give Me Some Purple Give Purple Have Fifteen Lunch Today Have Fifteen.. would look something like this string myInput Give Me Some Purple And More Elephants string pattern some pattern string.. this question Simple regex would be string input Give Me Some Purple And More Elephants string regex . . '. ' . string..

Is it secure to store passwords in cookies?

http://stackoverflow.com/questions/2100356/is-it-secure-to-store-passwords-in-cookies

in cookies My web application's home page has a RememberMe checkbox.. If the user checks it i ll store emailId and password.. The second parameter is used for Remember Me functionality if true it will create persistent cookies that..

OnclientClick and OnClick is not working at the same time?

http://stackoverflow.com/questions/2155048/onclientclick-and-onclick-is-not-working-at-the-same-time

false OnClick BtnSubmit_Click Text Submit Me OnClientClick allows you to add client side OnClick script... 'Submitting...' __doPostBack 'BtnSubmit' '' value Submit Me id BtnSubmit This gives a nice button disable effect and processing..

WPF - Set Focus when a button is clicked - No Code Behind

http://stackoverflow.com/questions/2204063/wpf-set-focus-when-a-button-is-clicked-no-code-behind

typeof Control typeof EventFocusAttachment new UIPropertyMetadata null ElementToFocusPropertyChanged public static void.. in your XAML do something like... Button Content Click Me local EventFocusAttachment.ElementToFocus Binding ElementName..

how to send mail using C#?

http://stackoverflow.com/questions/2354436/how-to-send-mail-using-c

share improve this question System.Net.Mail.MailMessage message new System.Net.Mail.MailMessage new MailAddress.. message new System.Net.Mail.MailMessage new MailAddress EmailUsername new MailAddress toemailaddress.. new MailAddress toemailaddress message.Subject Message Subject E.g My New Email message.Body Message Body E.g..

Debug Windows Service

http://stackoverflow.com/questions/2629720/debug-windows-service

it's a service not a process. Can Someone Explain To Me If I am supposed to see the service when I run Services.msc..

Detect Windows 7 in .net

http://stackoverflow.com/questions/2819934/detect-windows-7-in-net

Windows Windows Windows Windows Windows Windows 95 98 Me 4.0 2000 XP 2003 Vista 2008 7 2008 R2 PlatformID Win32Windows..

How can I programmatically access the Google Chrome Home or Start page?

http://stackoverflow.com/questions/4008194/how-can-i-programmatically-access-the-google-chrome-home-or-start-page

test class Program DataContract public class Mdata DataMember Name homepage public String homepage get private set DataMember.. Name homepage public String homepage get private set DataMember Name homepage_is_newtabpage public Boolean isNewTab get.. FindData String json Mdata deserializedData new Mdata MemoryStream ms new MemoryStream Encoding.UTF8.GetBytes json DataContractJsonSerializer..

How to release the occupied memory

http://stackoverflow.com/questions/5191897/how-to-release-the-occupied-memory

class constructor. Public Sub New ByVal handle As IntPtr Me.handle handle End Sub ' Implement IDisposable. ' Do not make.. object ' from executing a second time. GC.SuppressFinalize Me End Sub ' Dispose bool disposing executes in two distinct scenarios... ' Check to see if Dispose has already been called. If Not Me.disposed Then ' If disposing equals true dispose all managed..

Why does throwing 2 exceptions in a row not generate an unreachable code warning

http://stackoverflow.com/questions/6371564/why-does-throwing-2-exceptions-in-a-row-not-generate-an-unreachable-code-warning

statements. Do you see throw statements on that list Me neither. That's because we forgot it. Apologies for the inconvenience...

ObservableCollection Doesn't support AddRange method, so I get notified for each item added, besides what about INotifyCollectionChanging?

http://stackoverflow.com/questions/670577/observablecollection-doesnt-support-addrange-method-so-i-get-notified-for-each

Of T RaiseEvent CollectionChanging Me e End Sub End Class Public Interface INotifyCollcetionChanging..

How does WPF INotifyPropertyChanged work?

http://stackoverflow.com/questions/6789236/how-does-wpf-inotifypropertychanged-work

Center VerticalAlignment Center CheckBox Content Click Me IsChecked Binding Path CheckBoxState Mode TwoWay TextBlock Text..