Archive

Archive for the ‘Asp.Net’ Category

Build FTP Server with FileZilla

August 30, 2012 Leave a comment

Hello Friends.
After long time(around 2+ years) I am back again and inspired to write something.It’s ¬†around 2pm night and I am just finished my project work and I feel to write.

Today my Manager assigned me task to make web App live on client’s hosting server.We had developed Facebook Integration App for our client as per requirement and today I worked for make this web App live on server.so I remotely connected to server and start working to make this web app configure in IIS7.But there’s no FTP setup so it’s difficult for me to upload the source code on server.
At next moment I had setup Filezilla server and it saved my time ūüôā

Install the FileZilla FTP Server

The FileZilla server installation is a regular Windows “just press Next” wizard, and for most users, the suggested default settings will work. However, let’s take a look at its initial settings anyway, since they’ll affect how you work with your server. Here’s how to get FileZilla going:

  • Download the FileZilla server application.¬†Even though the FileZilla FTP client is available for multiple operating systems, the server app is Windows-only (and works for Windows XP, Vista and 2000).¬†Download it¬†and kick off the installation wizard. As of this writing, the latest server version is 0.9.25.
  • Run the server as a Windows Service.¬†First FileZilla will give you the option of how it should start up: as a Windows service or not, automatically or manually. Windows services are processes that run on your PC which you can manage from the Services management pane. There’s more on how to manage that below, but at this point, running FileZilla as a Windows service that runs automatically is the default option. If you want your FTP server on by default, choose “Start as service, started automatically (default)” as shown. Otherwise, choose “Start as service, started manually.”In this pane you’ll also set the port for the admin interface to use. By default it’s 14147, and you’re most likely safe leaving it at that. If you do change that port number, make a note of what it is‚ÄĒyou’ll need it to connect to the server later on.
  • Set the server administrative interface to launch automatically (or not).¬†On the final installation dialog, choose whether you want the server admin window to launch automatically when the current Windows user logs on, when any user logs on, or if it should be started manually.
  • Run and connect to the server with the admin interface.¬†As the installation wizard completes, set it to start the server admin interface. This is the window where you’ll configure your server and monitor its activity. The first time you run the admin interface, it will ask you for the server’s address and port. Since the server is running on your PC‚ÄĒthe same one the admin interface is running on‚ÄĒits address is¬†localhost, or¬†127.0.0.1. The default port is 14147 (or whatever you may have changed it to, as noted above), as shown:

    If this is the only FTP server you’ll be administering (most likely it is), check off the “Always connect to this server” box to bypass this dialog in the future.

Create Server Users

If all’s gone well, your server’s up and running‚ÄĒbut no one can use it yet, since you haven’t given anyone permission. To set up a server user, from the Edit menu choose Users. In the Users dialog on the right hand side, hit the Add button to create a new user and assign a password. Then, on the left side, select “Shared Folders” to set what folders that user will have access to on your server. Here I’ve created a user named gina and granted read access to theC:\data\¬†directory.

Notice you can fine-tune file access rights for each user: grant read-only rights (download only), write rights (to upload files), and whether or not the user can delete files or create directories, too.

If you want to grant several users access to your server all with the same rights and directory access, instead of creating each one individually, set up a user group. For example, if you’re sharing your MP3 directory with friends, make a user group called “music fans” with access to the correct directory and add users to that group, which automatically gives them those rights. Then, if you move your music directory you only have to edit the group, not each user in it. To manage user groups, from the Edit menu, choose Groups.

Log into the Server

Now that the server’s up and running with users, it’s time to log in and try uploading and downloading. Using any FTP client (like the¬†FileZilla client¬†or¬†FireFTP for Firefox) enter the server address, user name and password.

  • Server address¬†If you’re FTP’ing across your home network (like from your upstairs PC to your bedroom PC), you can reach the server by using its¬†internal¬†network address (most likely something like¬†192.168.xx.xx.) From the command line, type¬†ipconfig¬†to see what that address is. If you want to log into your FTP server over the internet, set up a memorable URL for it and allow connections from outside your network. To do so, check out¬†how to assign a domain name to your home server¬†and¬†how to access your home server behind a router and firewall.
  • User name and password¬†This is one of the users you set up in FileZilla’s admin interface,¬†not¬†the server admin user name. If friends, family, and co-workers will be logging into your FTP server, give them each a their specific username and password to log in (along with the server address.)

Use your FTP server to fetch files stored at home from anywhere, share files with friends and family, or back up files across your network. (Free backup software SyncBack supports backup over FTP. Here’s more on¬†how to use Syncback.)

A word about security:¬†FTP is not a secure protocol; all the file transfers happen in the clear, which makes them ripe for sniffing. FileZilla does support encrypted FTP access, and we recommend using that or a¬†VPN like Hamachi¬†to secure file transfers over the internet. FileZilla’s secure FTP server setup is beyond the scope of this article, but you can go into the server admin interface’s settings area to configure it.

Starting and Stopping Your Server in Windows Services

Finally, to shut down or restart your FileZilla server running as a Windows service, from Control Panel, Administrative Tools, launch Services. Right-click on the FileZilla FTP Server item on the list to stop it, edit its Properties, or restart it, as shown.

Hope this post helps you ūüôā

 

Categories: Asp.Net

Multiple File Uploader C# Asp.Net (Jumploader)

May 29, 2011 Leave a comment

Before few days i was developed a website where i was used asp.net file upload control. But the limitation is that user can select only single file at a time.But we require a file uploader with

  • ¬†Multiple File Selection (i.e. user can select multiple files to upload)
  • User can select only allowable Files (i.e. we can configure the file extention to upload)
  • Auto update when all files uploaded
  • It must be free control

I was tried a lot to find such file uploader and i was found that many multiple file uploader available with above mentioned features. But i like a JumpLoader

which is very useful and easy to use.

JumpLoader is a Java applet designed to upload files from the client to a server.

This is a valuable replacement for¬†<input type=”file”>

you can read more about JumpLoader at www.jumploader.com

I was used jumploader in my project with c# Asp.Net.

How to use Jumploader with Asp.Net

UI

We used follow http handler to upload the files.

  1. GalleryPhotos.aspx
  2. GalleryPhotoUpload.ashx
  3. jumploader_z.jar (Jumploader Jar file)

GalleryPhotos.aspx

Above snap displays the HTML for Jumploader jar file.

GalleryPhotoUpload.ashx

Dowload Source

Categories: Asp.Net

Asp.Net Jquery fly-to-Basket

December 30, 2010 9 comments

Today me and my friends searching for add to basket with Jquery.We found a good working demo of Jquery fly- to- Basket  at www.webresourcesdepot.com/fly-to-basket-effect-with-jquery/.This Jqury Fly-to-Basket developed with Jquery and PHP.I tried to develop the same fly-to-Basket effect to my exisitng e-commerce project.

Jquery Fly-to-Basket

Products List

Jquery Fly to Basket

<%@ WebHandler Language=’C#’ Class=’Handler’ %>
using System;
using System.Web;
public class Handler : IHttpHandler {
public void ProcessRequest (HttpContext context)
{
if (HttpContext.Current.Request.Form[“action”]!=null)
{
string action = HttpContext.Current.Request.Form[“action”].Trim();
if (action.Equals(“addToBasket”))
{
//call add to Basket
this.AddToCart();
//get CartDetails
string res = this.GetCartDetail();
context.Response.Write(res);
}
else if (action.Equals(“deleteFromBasket”))
{
}
}
}
public bool IsReusable
{
get
{
return false;
}
}
public void AddToCart()
{
//Code for inserting Item into Cart
}
public void DeleteFromCart()
{
}
public string GetCartDetail()
{
}
}
<%@ WebHandler Language='C#' Class='Handler' %>

using System;
using System.Web;

public class Handler : IHttpHandler {
    
    public void ProcessRequest (HttpContext context)
    {
        
        if (HttpContext.Current.Request.Form["action"]!=null)
        {
            string action = HttpContext.Current.Request.Form["action"].Trim();
            if (action.Equals("addToBasket"))
            {
                //call add to Basket
                this.AddToCart();
                
                //get CartDetails
                string res = this.GetCartDetail();
                context.Response.Write(res);
                 
              
            }
            else if (action.Equals("deleteFromBasket"))
            {
                
            }
        }
    }
 
    public bool IsReusable 
    {
        get 
        {
            return false;
        }
    }
    public void AddToCart()
    {
       
        //Code for inserting Item into Cart
    }
    public void DeleteFromCart()
    {
        
    }
    public string GetCartDetail()
    {
        return "

";
    }
    
}



Download

Categories: Asp.Net, JQuery

Keeping Your ASP.NET Session Alive Using jQuery

November 3, 2010 Leave a comment

When we are working with Asp.Net,We should take care about Session timeout.The time before timing out is normally configured in the web.config file. Sometimes sessions time out at the most inconvenient time for your users. They could start a page, fill in some data, go to lunch then come back, click next and one of two things happen. Either the user is redirected back to the starting screen,hat means the developer is not checking the session object for a null reference before using it.

One workaround for this is to keep the users session alive by running a small snippet of code which updates a session object.

First we create a Generic Handler.Below is the code for Generic Handler(i.e. SessionAlive.ashx)

public class SessionAlive : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
context.Session["KeepSessionAlive"] = DateTime.Now;
}

public bool IsReusable
{
get
{
return false;
}
}
}


public class KeepSessionAlive : IHttpHandler, IRequiresSessionState

If we didn’t inherit class from this interface, the ASP.NET Session wouldn’t be available and a null reference exception would be thrown. When you inherit a class from IHttpHandler, the main method that you use is ProcessRequest. All this method is doing is touching one ASP.NET session object simply to keep the session alive.

Now we write a javascript to call this SessionAlive.ashx code.For this we are using setInterval function.

Below is the Javascript Code

// <![CDATA[
javascript” type=”text/javascript” src=”http://code.jquery.com/jquery-latest.js”&gt;
// ]]>

<script language=”javascript” type=”text/javascript”>

$(function() {

setInterval(KeepSessionAlive, 10000);        });

function KeepSessionAlive() { ¬† ¬† ¬† ¬† ¬†¬†¬†¬† ¬† ¬† ¬† ¬† ¬†$.post(“/Shared/KeepSessionAlive.ashx”, null, function() {

$(“#result”).append(“<p>Session is alive and kicking!<p/>”);¬†¬† ¬† ¬† ¬† ¬† ¬†}); ¬†¬†¬†¬† ¬† ¬† ¬†}

</script>

<h2>Will my session die?</h2> ¬† ¬† ¬†<div id=”result”></div>

setInterval(KeepSessionAlive, 10000); That function runs a jQuery post to the HttpHandler KeepSessionAlive.ashx:

$.post(“/Shared/KeepSessionAlive.ashx”, null, function() {

This means every 10 seconds the session will be updated behind the scenes. This will give the impression to the user that their session will not time out.

Categories: Asp.Net, JQuery

The DEMO-CAMP East/West, the first complex event for the IT-branch and the Internet start-up in Poznan.

October 11, 2010 Leave a comment

On 22nd and 23rd October 2010 the DEMO-CAMP East/West, the first complex event for the IT-branch and the Internet start-up happening this year, will take place in Poznan.

The international event will gather Internet start-ups, venture capital, speakers and observers from all over Europe!

DEMOCAMP East/West 2010 stands for the already third edition of the fair for IT and start-up branches. The first edition of DEMOCAMP was held in 2008, and in May 2009 was followed with a more international focus. The great interest from start-ups and media was to be considered as an undoubted success, and that interest proved that there were many creative and unique ideas worth promoting and showing.

Encouraged by the success of previous editions, organizer the Polak 2.0 Foundation, decided to give it a go and continue the event, as it is the only one of its kind to be organized in Central Europe.

The whole event consists of modules like presentations of invited international speakers, the start-up exhibition, ‚Äėunconference‚Äô sessions and presentation stands as well as a discussion panel on co-investing with venture capital.

About 400 guests and participants as well as international competitors are expected to arrive and actively participate in this year DEMOCAMP edition.

There was an increase in the amount of initiatives aiming at the Internet start-ups this year, and DEMOCAMP will be something definitely outstanding!

The activities of the first day are going to be quite exciting, as the international Internet start-up competition will take place! Open to visitors, judged by experts, the competition allows each qualified team (15 this year) to present their ideas and to prove their concepts and business models in front of the public and jury, limited by 5 minutes only presentation time.

The first day also means the discussion panel for the venture capital on co-investing, that gives the companies and support institutions an opportunity to set up new business contacts.

The second day of the DEMOCAMP is marked by the ‚Äėunconference‚Äô session. The formula of ‚Äėunconference‚Äô prescribes that the division into observers and speakers is not natural any more. As the access to knowledge is widespread and easy, everyone with correspondending experience can share and discuss it with others. Numerous ‚Äėunconference‚Äô sessions will be simultaneously run by the participants of the event. An ‚Äėunconference‚Äô session means that every interested person can take the floor and share ideas, solutions and expectations. Recommended topics are those connected with setting up and developing a start-up company and Internet marketing.

So do not wait and join DEMOCAMP today! Become part of a great international event!

Visit democamp.org!

Organizer

DEMOCAMP is organized by the Polak 2.0 Foundation, which was established 2008 by a Polish company netguru ltd. As an experienced organizer of open meetings and Internet-related workshops, the Foundation can be proud of events like Barcamps in its home town of Poznan (more than 20 meetings and 2000 participants in total so far!)  and 24-hour marathon for programmers Hackfest as well as 2 previous editions of DEMOCAMP that happened in only less than two years mostly helped by private donations. The Foundation is open to new experiences and ideas , and 2010 new events like ShopCamp for the Internet shops or FoodCamp for catering industry took place, and got a very positive feedback from its participants. It also recognizes the challenges that every NGO faces, and in September 2010 for the second time, it facilitated BridgeCamp to promote IT among non-governmental organizations.

DEMOCAMP will be held in Poznan, at Poznan International Fair grounds, from 22nd to 23rd October 2010.

Important links

Further information @ our home page: http://democamp.org/

Follow us on twitter: http://twitter.com/democamp

Join us on Facebook: http://www.facebook.com/democamp

Questions? democamp@democamp.org

Type in Gujarati & UTF-8

January 4, 2010 1 comment

Hi,friends.I want to develop a application where user can choose either English or gujarati language for  writing.Before going to how to develop a gujarati typing with Asp.Net i advice you to read about what is Unicode and UTF format and why it is important.

What is Unicode?

Unicode is a computing industry standard allowing computers to represent and manipulate the text expressed in most of the world’s writing system.Developed in tandem with the¬†Universal Character Set standard and published in book form as The Unicode Standard, the latest version of Unicode consists of a repertoire of more than 107,000 characters covering 90 scripts.

The Unicode Consortium is a non profit organization that coordinates Unicode Development.It has ambitious goal of eventually replacing existing character encoding schemes with Unicode and its standard Unicode Transformation Format(UTF). More Details….

What is UTF-8?

UTF-8 is a (8-bit Unicode Transformation System) is a variable length Character encoding for Unicode.It is capable to represent any character in the unicode standard.(yet it’s backward compatible with ASCII).For these¬† reasons it’s¬† steadily become preferred encoding for E-mail,Webpages and othere places where characters are stored and streamed.

The Internet Engineering Task Force (IETF) requires all protocols to identify the encoding used for character data and the supported character encoding must include UTF-8.The Internet Mail Consortium(IMC) recommends that all e-mail programs be able to display and create mail using UTF-8.More…

How to Use Unicode  in Creating Gujarati Script?

Gujarati script is used to write Gujarati Language.

Gujarati alphabet mainly includes 34 consonants (ornamented sounds), 2 compound characters that are treated as consonants (not lexically though), and 14 vowels (pure sounds). Overall, the writing system comprises of 94 legitimate and recognized distinct symbols or shapes. In the current Unicode 4.1 implementation, however, only some of these symbols have been incorporated as glyphs or shapes. The remaining shapes are created by conjuctions.

Framework of a Gujarati symbol

1. Baseline area ‚Äď this is the placeholder for consonants and independent vowels

2. Area below and above the baseline ‚Äď used for placing lower (below-base) and upper (above-base) dependent vowels respectively

3. Area before and after the baseline ‚Äď used for writing left (pre-base) and right (post-base) dependent vowels respectively

What is Substitution?

Substitution, in the sense applicable here, means replacing a set or group of characters or shapes with a single character or shape. In practical terms, this translates as ‚Äď 1) multiple key-strokes will generate a single shape; and 2) the resultant shape will keep transforming itself (based on certain rules) in accordance with the user’s key-strokes or inputs.

Substitution can happen when you add one or more shapes in any of the positions other than the baseline area (see illustration above). Read More..

Now let’s start code for gujarti writing.

For this i found a useful Javascript.I used following two javascript file

1.Parser.js  & 2.Gujarati.js

Here is above image displays the writing pad where you can see gujarati words.For this i used a text area and a button.Text area is a simple HTML text area cotrol and set it’s name=”comment”.

Categories: Asp.Net

Comet and Reverse AJAX

December 5, 2009 Leave a comment

Today,i found a good example of Reverse AJax-comet with Asp.Net.Comet Example

  • Q. What is Reverse AJAX?
  • Ans.Reverse Ajax refers to an Ajax Design Pattern that uses long-lived HTTP connections to enable low-latency communication between a web server and a browser. Basically it is a way of sending data from client to server and a mechanism for pushing server data back to the browser.

In general Client-Server communication takes one of following two forms.

  1. Client Polling
    • With this method client repetitively sends a request(query) to the server and waits for the response.

2. Server Push

  • With this method connection between client & server kept open & server sends response when available.

For example,we have chat application and 2 clients and 1 server is available.Client-1 wants to send message “Hello Reverse AJAX” to all other clients.

First we consider tradition client polling method.

  • Client-1 sends message “Hello Reverse AJAX” to server.
  • Server receives message “Hello Reverse AJAX”.
  • Client-2 polls the server.
  • Client-2 receives the message “Hello Reverse AJAX”.
  • Client-1 polls the server.
  • Client-1 receives the message “Hello Reverse AJAX”

Imagine if we have more clients say up to 100 then each client needs to poll the server and waits until server response.It will creates a more traffic and puts load on server.At one stage server will too busy and it can’t serve more request.

Client Polling

Now let’s see what happenes if we use Server polling

  • Client-1 sends a message “Hello Reverse AJAX” to server.
  • Server receives the message “Hello Reverse AJAX”.
  • Server sends message “Hello Reverse AJAX” to all clients.

Advantage with server polling is that it creates less traffic. So messages are transferred with less delay(low latency).

Server Polling

Server Polling

There are some good  applications which are based on Comet Reverse AJAX.Many social community websites uses this technology.I found a very good example with PHP  on http://www.cometchat.com/

Hope this helps,

Jignesh


Categories: Asp.Net