Monday, June 27, 2011

SMS sending via Service Provider API in C#

This is the sample code which is use for sending SMS from window application in c#

using System.Net;
using System.IO;

 String strname = "http://isms.sapstech.com/pushsms.php?username=nishantvipul&password=12345&sender=VIPUL&to=9708094346,9263870334,94312350123&message=Hi%20This%20is%20a%20test%20message.&priority=2";
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strname);

            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            StreamReader reader = new StreamReader(response.GetResponseStream());

            string result = reader.ReadToEnd();
            MessageBox.Show(result);

Read the Excel file via C# using OLEDB class

This article explains how to read excel files using c sharp in windows applications-


using System.Data.OleDb;
try
            {
                string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + @"\Courier.xls;Extended Properties=ImportMixedTypes=Text;Excel 8.0;HDR=Yes;IMEX=1;";

                //You must use the $ after the object you reference in the spreadsheet
                OleDbDataAdapter adap = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connStr);

                DataSet ds = new DataSet();
                adap.Fill(ds, "Courier");
                dataGridView1.DataSource = ds.Tables["Courier"].DefaultView;
               

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

Explanation of the above code:
Here I used OleDb to read the excel file. The excel file resides with exe file as Courier.xls.
Sheet1 is the name of excel sheet.
Courier is the name of file so i am using the same name in filling the DataSet.
Now at last the data is filled into dataGridView.
Now if you are not able to read the integer value or any value other then text then
include the
Extended Properties=ImportMixedTypes=Text;Excel 8.0;HDR=Yes;IMEX=1 property in connection string.

The above code can also be used in a web application, for this you need to replace the Application.StartupPath with Server.MapPath

Useful link to know more about excel file using c# : http://csharp.net-informations.com/excel/csharp-read-excel.htm

Thursday, November 4, 2010

Sites for Editing Images

In this column, we will mention sites which will helpful to make your photo more beautiful-

http://funny.pho.to/ : Creating photo collages from your photos online. Applying photo effects is pure joy! Create realistic photo montages and add cute frames to your photos. Write your text on this picture if you wish to get an e-card.

Eclipse

Here we will discuss about Eclipse tool's feature:-

> Suppose you are accessing eclipse tool first time in your system and this tool have projects under workspace but it is not showing in your system. Then you need to do that go to file menu and select switching workspace and browse where your workspace that's it.

Eclipse

Here we will discuss about Eclipse tool:-

> Suppose you are accessing eclipse tool first time in your system and this tool have projects under workspace but it is not showing in your system. Then you need to do that go to file menu and select switching workspace and browse where your workspace that's it.

Wednesday, November 3, 2010

Important Keywords

We are going to explain here about different-different keywords which is useful in computer life:-

> Specification Vs Implementation
I am explaining here via a example that
Sun is provided Java technology i.e Specification. But different different vendors (like IBM, Oracle) made own JVM by considering Sun specification that is called Implementation.

Important Utilities

In this column, we will mention important utilities which is useful sometimes in your computer-life to solve problems:-


> Unlocker

Surely you have faced these types of problems in computer:-

"Generic volume cannot be stopped right now" error when Removing a pen-drive/External Hard Disk
"Cannot delete file: Access is denied" error when deleting a file
There has been a sharing violation.
The source or destination file may be in use.
The file is in use by another program or user.
Make sure the disk is not full or write-protected and that the file is not currently in use.
                                Unlocker is the best solution!
    Refer this site to more information: 

> VirtualDub

I've been looking for a way to capture my screen. I've found a lot solutions, but all of them I've found one! VirtualDub coupled with VH Screen Capture Driver works like a charm! And also you can capture video from Webcam by this Software.

Follow this link to know the steps how to do the screen capturing with VirtualDub:
http://www.donsalva.com/2009/08/10/real-time-screen-capturing-recording-with-virtualdub-and-vhscrcap