Weblog Of Nirandas | home

Developer From INDIA

hide email and other sensitive information from spam harvesters

clock September 24, 2008 16:28 by author

Often we have to display email addresses and other contact information on our pages. For example providing a mailto link etc. However, along with the intended users, some other persons/bots are also interested in getting those email IDs for sending spams. For this, spammers use special bots for harvesting email/contact info from the web. In this post, I will show a method using javascript and any server side language by which we can easily protect such important information.

More...

Be the first to rate this post

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


creating GUIDs in .net

clock September 21, 2008 12:58 by author
After an interval of more than 2 weeks, I am back online blogging. Today I will share a quick tip on how to create a guid in C# and vb.net. For a description about GUIDs, visit this Wikipedia page.A guid in the .net world is represented by the System.Guid class. The Guid class has many constructors which takes 0 or more arguments and constructs a guid from it. However, if we want to create a random guid, using the parameter less constructor would not do. A guid created using the parameter less constructor contains all zeros. So how to create a unique guid?

Guid.NewGuid() method

The Guid class has a static method named NewGuid() which creates and returns a new random guid. Let's see a example.
C#
Guid g=Guid.NewGuid();                             MessageBox.Show(g.ToString());
VB.NET
Dim g As Guid =Guid.NewGuid()                             MessageBox.Show(g.ToString())
Here we are simply creating a new guid and using ToString() method for displaying it. You can also get byte representation of the guid using ToByteArray() method.Enjoy!
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

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


Expanding paths containing Environment variables

clock September 2, 2008 14:47 by author
Sometimes we may need to expand paths like "%systemroot%\program.exe" etc programmatically. Specially values in the registry are encoded in this format. The .net framework provides us a straightforward method using which we can easily convert strings containing such special variables into their values.

Environment.ExpandEnvironmentVariables() method

More...

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