Weblog Of Nirandas | home

Developer From INDIA

Sending email using a gmail account in C#

clock November 17, 2009 00:35 by author Nirandas

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

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Preventing SQL injection specially for PHP developers

clock November 10, 2009 06:23 by author Nirandas

SQL injection happens when user provided input through forms or query string is directly used in a SQL query without any sanitation done to it. For example a badly coded login script would allow an attacker to login without knowing the username/password or login with full rights of admin users. Though this can happen to any web page developed in any language, this issue seems to be affected more PHP pages than .NET applications. Perhaps simplicity of PHP programming and inexperience coders are reasons for this. In any case, keeping following poins in mind while developing PHP sites should help avoid mistakes which can be prevented easily.

More...

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Find matching items from a List - simple example of VB.NET 2008 lambda function

clock November 9, 2009 05:15 by author Nirandas

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.

Dim MatchedItems As List(Of User) = Members.FindAll(Function(u As User) (u.Age<18))

Here the FindAll() function is accepting a Predicate(Of User) Delegate. And we can pass lambda functions where ever a delegate to a function is accepted. The FindAll() method calls our lambda function for each item in the list for deciding whether the item matches our requirements. If it does (our Predicate(Of T) returns True) the Item is included in the returned list.

Another nice thing is that this feature (lambda functions) are supported even in projects where the target .NET framework version is 2.0. So, we can use these lambda functions in our .NET 2.0 application as wel.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Who Am I?

I am Nirandas - a developer from INDIA

Sign in