Archive for the ‘.Net’ Category

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...

Creating a basic Web Service

This item was filled under [ .Net ]

A lot can be found on the internet regarding web services. Here am just gonna create a basic Web Service using ASP.Net/C#:
1. Run your Microsoft Visual Studio 2005
2. Create a new ASP.Net Web Service from File > New > Web Site > ASP.Net Web Service
3. Choose the language of your choice, enter a project name [...]

Continue reading...

Running ASP.Net on Windows Server 2003

This item was filled under [ .Net ]

I deployed an ASP.Net 2.0 application on Windows Server 2003 and was continously getting:
HTTP Error 404 - File or directory not found
I Googled for it, but couldn’t find much as most of the users faced the same issue deploying ASP.Net applications on Server 2003. Microsoft suggests re-checking ASP.Net installation, as it is not automatically installed [...]

Continue reading...

Connection string for TeraData

This item was filled under [ .Net ]

To connect to a TeraData database, use the following connection string to create an OleDbConnection:
Provider=TDOLEDB;Data Source=SERVERNAME;Persist Security Info=True;User ID=MyUser; Password=MyPassword;Session Mode=ANSI;

Continue reading...

Integrating FCKEditor with ASP.Net

This item was filled under [ .Net ]

FCK editor is a good Rich Text Editor for ASP.Net web pages but its documentation lacks few final steps. Adding a little to it:

Download the FCK editor package as well integration DLL from: http://www.fckeditor.net/download
Follow the installation steps of FCK editor official Docs
Now, I hope you have added reference and created your ASPX page. If [...]

Continue reading...

IIS Performance Monitor

This item was filled under [ .Net ]

Sitting a little idle at my office desk today (waiting for my manager to arrive), I was trying to figure out some way through which IIS performance can be monitored. And like always, next step was ‘Google‘. Found a small easy-to-use application which is quite handy! Check out the snap and its features below:

“Web Performance [...]

Continue reading...

Run a .BAT file from .Net with parameters

This item was filled under [ .Net ]

Last week, I had to execute a batch file using ASP.Net with parameters. I searched couple of forums, tried few codes but one of them worked really nice. I have tweaked the code to use parameters and its working! =)
public string executeBAT(string workingDir, string batchFile, string batchParameters)
{
//workingDir e.g. "c:\\temp\\" (where your batch file is placed)
//batchFile [...]

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...

Page 1 of 212»