c#.net

Send free SMS API

http://ubaid.tk/api-usage/

Required Params : uid, pwd, phone, msg.

uid : your userid for the required sms provider
pwd : your password for the required sms provider
provider : way2sms(default), fullonsms, smsindia, whozzat, smsinside, site2sms. if you do not specify any provider, way2sms will be used by default.
phone : phone number whom you want to send sms. seperate multiple phone numbers with a comma (,)
msg : your sms message, unlimited chars. will be sent as multiple msgs if crosses the message length for any provider

Optional Parameters
codes : 1. Send this if you require a user friendly msg from the server. for example, if codes=1 is not provided the server will return the result as an integer.
1 – SMS sent
-1 – Server Error
-2 – Invalid Username
-3 – Invalid message text
-4 – Login Failed
-5 – IP Blocked

Microsoft Office Document to PDF convert

OfficeToPDF is a command line utility that converts Microsoft Office 2007 and 2010 documents from their native format into PDF using Office’s in-built PDF export features.

OfficeToPDF is useful (and unique) if you want to automatically create PDF files on a server-wide basis and free individual users from an extra step of using the “Save as…” command on their Office files.

software needs to be installed on Server:
.NET Framework 4
Office 2010 or Office 2007

If you are using Office 2007, you will also need:
Visual Studio 2010 Tools for Office Runtime [Download]
2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS [Download]

Supported File Types:
Word (.doc, .dot, .docx, .dotx, .docm, .dotm)
Excel (.xls, .xlsx, .xlsm)
Powerpoint (.ppt, .pptx, .pptm)
Visio (.vsd)
Publisher (.pub)

Download Office 2 PDF
How to execute on command line?

C:\prakash>officetopdf.exe test.docx test.pdf

PDF to Image

First of all you have download “GhostScript” from Here Installed it.

C#.net Code as below

1) Create a new console application in Visual Studio 2010.

2) Copy the below code into your application

public static void PdfToJpg(string ghostScriptPath,string input, string output)
{
//String ars = "-dNOPAUSE -sDEVICE=jpeg -r300 -o" + output + "-%d.jpg " + input;
 String ars = "-dNOPAUSE -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r150*150 -o" + output + "-%d.png " + input; //all image generate with full clarity and same pixel size (1275*1650)
Process proc = new Process();
proc.StartInfo.FileName = ghostScriptPath;
proc.StartInfo.Arguments = ars;
proc.StartInfo.CreateNoWindow = true;
       proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
       proc.WaitForExit()
}
 
Where,
ghostScriptPath: Refers to the full path of the exe file
input: Refers to the full path of the pdf file to covert.
Output: Refers to the full path of the image file name.
For eg.,
static void Main(string[] args)
{
string ghostScriptPath = @"D:\Program Files\gs\gs9.01\bin\gswin32.exe";
string inputFileName = @"C:\test.pdf";
string outputFileName = @"E:\New\test";
PdfToJpg(ghostScriptPath, inputFileName, outputFileName);
}
·       3)  Set the output type of your console application to “Windows Application”.
That’s it.

Super Impose Image

Refere Link: http://www.codeproject.com/KB/GDI-plus/watermark.aspx

Download code: https://skydrive.live.com/?cid=efc0ec2e2cd761ee#!/?cid=efc0ec2e2cd761ee&id=EFC0EC2E2CD761EE%21150

impose one image on another image. it’s also called watermark effect also.

Cross Platform Socket Programming (Mac-Windows)

Overview: Sockets vs Streams

Socket represents a unique communication endpoint on the network. When your app needs to exchange data with another app, it creates a socket and uses it to connect to the other app’s socket. You can both send and receive data through the same socket. Each socket has an IP address and a port number (between 1 and 65535) associated with it. IP address uniquely identifies each computer on a given network and port number uniquely identifies a network socket on that computer.

Stream is a one-way channel through which data is transmitted serially. There are 2 types of streams: the ones into which you can write data, and the ones from which you can read. By itself, stream is just a buffer that temporarily holds data before or after its transmission. In order to actually deliver data somewhere meaningful, streams need to be tied to something (like a file, a memory location etc). In this tutorial, we’ll use streams that are paired up with sockets to allow our app to send data over network.

Overview: Bonjour

Bonjour is a protocol that allows devices or applications to find each other on the network. More precisely, it provides a way for an application to tell others what IP address and port they can connect to in order to communicate with it. In Bonjour terminology, such announcement is called publishing a service. Other apps can then look for services by browsing. Once an app finds a service that it would like to talk to, it resolves the service to find out what IP address and port number it needs to establish a socket connection to.

In the SDK, Bonjour can be used via NSNetServices and CFNetServices APIs.