Articles Archive for June 2009
Asp.net »
Some time we need to send mails to others from our application, and fro this we need to use some free email server like GMAIL. here is the code using that we can use the gmail mail server to send the mails. I am simply specifying the gmail SMTP server name and the Port number in the code.. take a look…
MailMessage mailMessage = new MailMessage();
mailMessage.To.Add(“test@test.com”);
mailMessage.Subject = “Test”;
mailMessage.Body = “<html><body>This is a test mail</body></html>”;
mailMessage.IsBodyHtml = true;
// Create the credentials to login to the gmail account associated with my custom …
CSharp »
Empty the Recycle Bin
Ths following code is used to empty the recycle bin using Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio
The namespace we have to use is:
using System.Runtime.InteropServices;
then create an enum for recylceflags like
enum RecycleFlgs : uint
{
SHERB_NOCONFIRMATION = 0×00000001,
SHERB_NOPROGRESSUI = 0×00000002,
SHERB_NOSOUND = 0×00000004
}
creating an extern
[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]
static extern uint EmptyRecycleBin
(IntPtr hwnd,
…
CSharp »
using System;
class SortReverse
{
public static void Main()
{
int[] x={30,10,80,90,20};
Console.WriteLine(“Array Before Sorting”);
foreach(int i in x)
Console.Write(” “+i);
Console.WriteLine();
Array.Sort(x);
Console.WriteLine(“Array After Sorting”);
foreach(int i in x)
Console.Write(” “+i);
Console.WriteLine();
Array.Reverse(x);
Console.WriteLine(“Array After Reversing”);
foreach(int i in x)
Console.Write(” “+i);
Console.WriteLine();
}
}
Hi,
Here is a simple way to sort an array. We can use the Array.Sort() function for applying the sorting. Here I am going to display a short code snippet for your use. Try and and post your comments here. If any suggestions or need some clarifications
using System;
class SortReverse
{
public static void Main()
{
int[] x={30,10,80,90,20};
Console.WriteLine(“Array Before Sorting”);
foreach(int i in x)
Console.Write(” “+i);
Console.WriteLine();
Array.Sort(x);
Console.WriteLine(“Array After Sorting”);
foreach(int …
