redcap

Stories submitted by redcap

Sending email using a gmail account in C#(blog.nirandas.com)

submitted by redcapredcap(420) 2 years, 2 months ago

Sending emails using your gmail account is very simple in C#/VB.NET using .NET framework 2.0+. The below code snippet shows how. read more...

add a comment |category: |Views: 11

tags: another

Find matching items from a List - simple example of VB.NET 2008 lambda(blog.nirandas.com)

submitted by redcapredcap(420) 2 years, 3 months ago

Here is a very simple example showing how to find all matching items from a generic List(of T) using lambda functions in VB.NET. read more...

add a comment |category: |Views: 2

tags: another

Redirecting the console output to a stream(blog.nirandas.com)

submitted by redcapredcap(420) 2 years, 5 months ago

Shows how we can capture Console output and redirect it to a file. read more...

add a comment |category: |Views: 6

tags: another

Fastest way of copying bytes in C#(nirandas.com)

submitted by redcapredcap(420) 2 years, 6 months ago

If you ever have come across having to copy a block of bytes from an array to another location, the fastest method I found in .NET framework is using the System.Buffer.BlockCopy() read more...

add a comment |category: |Views: 17

tags: another

Expand short URLs of tinyurl, bit.ly, tr.im etc(nirandas.com)

submitted by redcapredcap(420) 2 years, 6 months ago

Popularity of services like twitter and other social networking sites have resulted in an exponential growth in the number of URL shortening services. bit.ly, tr.im are just few of the example. In this post I'll show how we can programmatically discover the hidden URL behind the shortened one. read more...

add a comment |category: |Views: 51

tags: another

Creating global hotkeys using managed Win API(nirandas.com)

submitted by redcapredcap(420) 2 years, 7 months ago

.NET framework does not by default provide classes/methods for creating global hotkeys in our .NET applications. A hotkey can be defined as a particular key combination pressing of which triggers a event in our application even if user is not actively working on our app. For achieving this, we’ll have to call into win32 api functions. Though .NET framework makes this work relatively easy, still calling into managed dlls and wrapping them in .NET classes read more...

add a comment |category: |Views: 115

tags: another

Quick FTP file upload in .NET(nirandas.com)

submitted by redcapredcap(420) 2 years, 7 months ago

Uploading files using FTP is quick and easy in .NET framework. Below is a simplest possible method to upload a local file to a FTP server. Example is in read more...

add a comment |category: |Views: 136

tags: another

If blocks and readable code(nirandas.com)

submitted by redcapredcap(420) 2 years, 7 months ago

Writing readable code is as important as writing high performance working code. One of the things which can easily affect the readability of the code we write is improper structuring of if/else blocks. read more...

add a comment |category: |Views: 13

tags: another

Using Email instead of Username for logging in(nirandas.com)

submitted by redcapredcap(420) 2 years, 8 months ago

The Login control does not by default allow to set whether to use username and password as the log in or email and password should be used. In this post I'll show how we can easily change this behavior and allow our members to use their email address while logging in. read more...

add a comment |category: |Views: 25

tags: another

Where can I set target platform to .net 2.0 in vs2008(nirandas.com)

submitted by redcapredcap(420) 2 years, 8 months ago

VS2008 allows to target multiple .NET versions (V3.5, V3.0 and V2.0). But where exactly to set it? The thing is that this setting is found at different read more...

add a comment |category: |Views: 14

tags: another

Beginning Reflection.Emit, a basic example(nirandas.com)

submitted by redcapredcap(420) 3 years ago

The System.Reflection.Emit namespace provides us the tools required to generate .NET code on the fly. Especially the DynamicMethod class makes the job of creating small code snippet easier. In this post I’ll show a simple example of dynamically creating a method which takes a string as its argument and returns a string “hi “prepended to it. First, we will create the DynamicMethod object specifying the argument list and the return type of the dynamic method. Next read more...

add a comment |category: |Views: 43

tags: another

Determining if a Type implements an interface(nirandas.com)

submitted by redcapredcap(420) 3 years ago

If we have an object of a type, we can easily check if that object implements a particular type by using is operator. However, we cannot use is operator if all we got is a type and we want to find whether that type implements a particular interface. read more...

add a comment |category: |Views: 23

tags: another

Failing tests as a reminder of unimplemented requirement(nirandas.com)

submitted by redcapredcap(420) 3 years, 1 month ago

passing the Type System.String to a method where the method expects a Type which implements a particular interface ICommand should result in an error because the System.String does not certainly implements the interface ICommand. But does the method validate the input? read more...

add a comment |category: |Views: 6

tags: another

Sorting list<t> the easy way using lambda expressions(nirandas.com)

submitted by redcapredcap(420) 3 years, 1 month ago

Introduction of lambda expressions in .NET 3.5 have simplified many operations. One of them is sorting List&lt;t&gt; of complex types. For example assume that we have a type named Person and it has a Name property among other properties. Now if we want to sort a list of List&lt;Person&gt; on the Name property, we just have to use a single li read more...

add a comment |category: |Views: 116

tags: another

Always explicitly detach explicitly attached event handlers(nirandas.com)

submitted by redcapredcap(420) 3 years, 2 months ago

We extensively use events in our .net programs. Most of the times, it doesn’t give you debugging worries. However in some cases, it can become an issue where your object containing event handler doesn’t get garbage collected due to event raising object holding a reference to the listener object. read more...

add a comment |category: |Views: 21

tags: another

Visual Studio 2005 - Disabling the New Ctrl+Tab Menu « Collin Grady(collingrady.wordpress.com)

submitted by redcapredcap(420) 3 years, 2 months ago

One of the few things I disliked about Visual Studio 2005 is the new Ctrl+Tab menu they added, which works sort of like Alt-Tab in Windows, but is fairly useless in an IDE - it just slows down Ctrl+Tab operation by requiring you to release both Control and Tab each time you want to change documents, so you read more...

add a comment |category: |Views: 4

tags: another