Posts Tagged ‘.Net’

Write PDF files using .Net

This item was filled under [ .Net ]

“iText is a library that allows you to generate PDF files on the fly” – using this library, one can easily write PDFs in .Net. To get started, download the library from http://www.lowagie.com/iText/ (or SourceForge.net).
After downloading the .dll file, add it as a reference in your application.
Sample code (C#.Net):

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;

namespace [...]

Continue reading...

Sending email through .Net

This item was filled under [ .Net ]

In .Net, you can easily send an email through MailMessage() class. Below is a little ConsoleApplication that shows how to send a simple email in .Net:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Mail;

namespace ConsoleEmailApp
{
class Program
{
static void Main(string[] args)
{
MailMessage objMail = new MailMessage("<a href="mailto:from-email@domain.com">from-email@domain.com</a>", "<a href="mailto:to-email@domain.com">to-email@domain.com</a>");
SmtpClient objSMTP = new SmtpClient("smtp.host.com", 25);

objMail.Subject = "Sending email through .Net";
objMail.Body = "Hello World!";

objSMTP.Credentials = new [...]

Continue reading...

Consuming a Web Service through Console application

This item was filled under [ .Net ]

In my last post, I created a basic web service using ASP.Net/C#. Now, I will simply consume it. The basic advantage of Web Services is that it can be consumed through any language/platform.
1. Create a new Console Application Project in .Net
2. After creating the project, right click your project name from the “Solution Explorer” and [...]

Continue reading...

Using a Java class in .Net

This item was filled under [ .Net ]

It might sound a little complex using Java package in .Net but trust me, the interoperability is quite easy I’ll explain the procedure in few simple steps:
1. Create a simple Java class, for e.g.
public class CalculatorX {

public int Add(int firstNum, int secondNum)
{
return firstNum + secondNum;
}

}
2. Compile it to create a .class
> javac calculatorx.java
3. [...]

Continue reading...

HTML Controls or ASP.Net Controls?

This item was filled under [ .Net ]

Often developers need to convert their HTML pages to ASP.Net. In that case, the picture is not clear whether to convert all controls or..? Similarly, while adding controls to a page, what choice should be made as regard of HTML and ASP.Net controls? The answer is quite simple. For your static HTML layout, you may [...]

Continue reading...