Next step of programming

Just another WordPress.com weblog

Microsoft Live Writer 2009

leave a comment »

WLWriter

Latest version of the Microsoft Live is released on 12/Feb/2009 . It is one of the good software for blogging. It supports various blog service like wordpress, typepad, blogger etc.

As Microsoft is already know for the GUI they provide. Once again the features and GUI of the Live writer are remarkable. Editing is very easy and very useful features are there like

1. Spell Checking

2. Insertion of Pictures, Albums, Tables, Maps

3. List existing Tags from the your blog

4. Set publishing date

 

Interface is very remarkable.

Image Editing

Image Editing Tools Image Editing Tools Image Editing Tools

Nice set of image editing tools/features which can save you time and can give you nice images for your blog.

You can set the layout of the images with there borders.

In Advance options you can resize the images as well you can crop. Even you can rotate, change contrast and add watermark to image

 

 

 

 

Image Crop

Crop Image

Image Cropping tool which can save your time. It is just i was looking for editing my images for blog. Now i can just work with in live writer rather using various software. You can rotate your image too

 

Maps

Include the map for any location which provided by Microsoft Virtual Earth

 

 

 

 

 

 

Category Selection

Category Selection

One can easily select the category for the post. User can even search for existing one and can create new one also.

Plug-ins

Plugins

What more ? You can download hundreds of plug-ins for your live writer, Which will enhance your blog editor and solve out your various problems http://gallery.live.com/results.aspx?c=0&bt=9&pl=8&st=5

 

 

 

 

imageOne of the plug-in “Insert Code for Windows Live Writer”. It will really help you to insert code in your blog with color, line numbering and even with line colors

Written by A.Sethi

March 4, 2009 at 8:45 am

Posted in Updates & News

Tagged with , , , ,

Captcha Control Sample (C#, ASP.NET, Server Control)

with 6 comments

In various websites, Captcha control is used for validating the user input and protect web application from the program. Here is one of the sample control for Captcha. It is basic one which can be enhanced further by including more to the image generation and even including the timeout. Or you can add much more to it

This application has two parts

1. CaptchaControl
2. CaptchaControl Sample Project

Captcha control has three files.

1. CaptchaControl (Which is the main control)
2. CaptchaImage (Which generates the Captcha image)
3. CaptchaImageHandler (which will provide the image to browser from the cache).

You can download it from (Captcha Control Sample)

Captcha Sample Control

Captcha Sample Control

Written by A.Sethi

February 26, 2009 at 4:17 am

Posted in ASP.NET, Controls

Tagged with , , , ,

Windows 7 Features Part 1

leave a comment »

Aero Shake Feature

Shaking your windows can make other windows minimize or maximize check out the video

Written by A.Sethi

February 16, 2009 at 7:32 am

Posted in Updates & News

Tagged with ,

Listing All the references of Assembly

leave a comment »

We can list all the references of the assembly in a recursive manner. Here i have avoided System Assemblies since those are not required & they are in circular references. Download the code from this link


private void btnList_Click(object sender, EventArgs e)
{
txtReferences.Text = "";

OpenFileDialog openFileDlg = new OpenFileDialog();
if (openFileDlg.ShowDialog() == DialogResult.OK)
{
txtAssemblyPath.Text = openFileDlg.FileName;
Assembly assembly = Assembly.LoadFrom(txtAssemblyPath.Text);
ListReferences("",assembly);
}

MessageBox.Show("Listing Completed");
}

public void ListReferences(string location, Assembly assembly)
{
//List all references            
string name = assembly.GetName().Name;
string CurrentLocation = location;
txtReferences.Text += CurrentLocation + ">" + name + "\r\n";
location += "--";

if (!name.StartsWith("System.") && !Name.Equals("System"))
{
foreach (AssemblyName assemblyName in assembly.GetReferencedAssemblies())
{
assembly = Assembly.Load(assemblyName);
ListReferences(location, assembly);
Application.DoEvents();
}
}
}

Written by A.Sethi

February 13, 2009 at 7:15 am

Posted in Reflection

Tagged with , , ,

Silverlight for Linux (Moonlight)

leave a comment »

Moonlight Logo

Moonlight Logo

Moonlight is alternative of Silverlight for linux & Unix users. It was the result of technical collaboration between Microsoft and Novell. You can get plugins for Firefox browsers of Moonlight from Novell. They are working on two version of Moonlight, Moonlight 1 & Moonlight 2. For more details check out this link

To download Moonlight 1.0 plugin follow this link

Written by A.Sethi

February 12, 2009 at 5:32 am

Posted in Updates & News

Search your website (Microsoft Indexing Service, C#, ASP.NET)

with one comment

You might have seen various website providing search capabilities to search content within their website. Implementing this in our web application is also easy and for that we have to just use the indexing service to create indexes of our pages. Microsoft is providing indexing service which we can utilise for this purpose.

To understand what is indexing service click this link

Now you might wonder how to get this service in your system. For that follow the steps

1. Goto Control Panel > Add Remove Programs
2. Click “add remove windows component”
3. from the screen select “Indexing service” and install

Installing Indexing Service

Installing Indexing Service

Now you have indexing service in your system. From computer management you can see the indexing service and can manage it. We need to create new catalog which will contain the indexes. To that catalog we will add the directories which are to be indexed.

Indexing Service Management

Indexing Service Management

There are other settings too like Indexing Service usage and etc. For that right click your indexing service node and select All Task > Tune Performance

Tune Performance (Updating Indexes)

Tune Performance (Updating Indexes)

We can now implement this in our web application to search the web pages. Below sample code is written for seaching and displaying the content in the ASP.Net Page

 string connectionString ="Provider=MSIDXS;Data Source=MISSample;";
OleDbConnection connection = new OleDbConnection(connectionString);
connection.Open();

string query = @"SELECT Path, FileName, size, write, attrib, Characterization,
DocTitle FROM SCOPE() " +
"WHERE FREETEXT(Contents, '*" +  txtQuery.Text + "*')";
OleDbCommand command = new OleDbCommand(query, connection);
OleDbDataAdapter adapter = new OleDbDataAdapter(command);

DataSet dataSet = new DataSet();
adapter.Fill(dataSet);

GridView1.DataSource = dataSet.Tables[0];
GridView1.DataBind();
connection.Close();

Sample Output

Sample Application

Sample Application

Written by A.Sethi

February 11, 2009 at 9:51 am

Posted in ASP.NET

Tagged with , , , ,

Get a free Web site (Microsoft)

leave a comment »

Microsoft is now providing free web spaces. Office Live Small Business provides a free web site and hosting, free e-mail, and other online tools for your business

What you will get

  • Web Site
  • Web hosting and Site Design tool (500 MB of Web site storage and easy-to-use design templates )
  • Site Traffic Reports (visitor statistics, page views, top referrers, and more)
  • Contact Manager (sales opportunities, contact information, and track customer interactions)
  • Business Applications (Document Manager, Project Manager, and Workspaces)
  • Click to get started Office Live

    Check the sample dashboard below.

    Free website from microsoft

    Free website from microsoft

Written by A.Sethi

February 11, 2009 at 4:19 am

Posted in Updates & News

Tagged with , , ,

XML Serialization

leave a comment »

Some time we need to save the data in the files which is nothing but the details of the object. For example i am having a application doing vector drawing and i want to save the details of the line object not the image file. How to save the line object and how to get it back. We can use serialization with which we can save our object in file directly and can load it too. Also we can use XML Serialization which is so popular these days.

We have to just mark out objects and class with certain Attributes like XMLRoot, XMLElement, XMLAttribute and so on.


using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;

namespace XMLSerialization
{
static class Program    
{
static void Main()
{
DoSerialization();
}

private static void DoSerialization()
{
Student student1 = new Student { Name = "A", Marks = 23 };
Student student2 = new Student { Name = "B", Marks = 25 };
Students students = new Students();

students.StudentList.Add(student1);
students.StudentList.Add(student2);

XmlSerializer xmlSerialize = new XmlSerializer(students.GetType());
StreamWriter writer = new StreamWriter("a.xml");
xmlSerialize.Serialize(writer, students);
writer.Close();

StreamReader reader = new StreamReader("a.xml");
Students studentsfromFile = (Students)xmlSerialize.Deserialize(reader);

foreach (Student st in studentsfromFile.StudentList)
{
Console.WriteLine("Name : {0} Marks : {1}", st.Name, st.Marks);
}

Console.ReadLine();
}
}

[XmlRoot("Students")]
public class Students    
{
[XmlElement("Student")]
public List<Student> StudentList = new List<Student>();
}

public class Student    
{
[XmlElement("Name")]
public string Name;
[XmlElement("Marks")]
public int Marks;
}
}

Written by A.Sethi

February 10, 2009 at 10:24 am

Sample weather forecast WCF application.

leave a comment »

Here is one WCF webservice sample developed for weather forecasting. Two projects are include one is web application another one is wcf application. Download and check out

Weather Forecast WCF Sample

Weather Forecast WCF Sample

Written by A.Sethi

February 10, 2009 at 8:17 am

Netstat in C#

leave a comment »

Check out how to perform Netstat command functions of DOS in C#. It will list you all the current network connections of your System


using System;
using System.Net;
using System.Net.NetworkInformation;

namespace MyNetstat
{
class Program    
{
static void Main(string[] args)
{
IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();

IPEndPoint[] endPoints = ipProperties.GetActiveTcpListeners();
TcpConnectionInformation[] tcpConnections = ipProperties.GetActiveTcpConnections();

foreach (TcpConnectionInformation info in tcpConnections)
{
Console.WriteLine("Local : " + info.LocalEndPoint.Address.ToString()
+ ":" + info.LocalEndPoint.Port.ToString()
+ "\nRemote : " + info.RemoteEndPoint.Address.ToString()
+ ":" + info.RemoteEndPoint.Port.ToString()
+ "\nState : " + info.State.ToString() + "\n\n");
}
Console.ReadLine();
}
}
}

Written by A.Sethi

February 9, 2009 at 12:09 pm