C# - Using Some Class Library - Want To Know The Country Of The Visitor And Use That Country Name To Redirect The Visitor To Some Webpage Accordingly

Sep 10, 2010

My code:

protected void Page_Load(object sender, EventArgs e)
{
String userHost = Request.UserHostName
}

This is fetching the IP address alright, but now I want to know the country of the visitor and USE that country name to redirect the visitor to some webpage accordingly.

I came across this library but have no clue how to use it in the project. Actually I do, but I am not sure so I am asking.

http://ipaddressextensions.codeplex.com/

When I download from the above the ZIP folder has a DLL file and an XML file. Now, what do I do with these two? Like include in the project. Then what do I type in the code file?

Something like the following.

if (countryName=="France")
{
response.redirect("www.mysite.fr") [code]....

How do I go about it? Also do I really need to type SO many if blocks for ALL the countries. How do I shorten this code?

View 2 Replies


Similar Messages:

Web Forms :: Ip's Per Country Counter / Ip For Website Visitor?

Apr 16, 2010

how could i know the count for my website visitors/ Countries? how can i know the ip for my website visitor?

View 3 Replies

Web Forms :: Dropdownlist Contain The Country List From Country Table When Load Page

Aug 10, 2010

i have one dropdownlist in the gridview. i have to load that dropdownlist when that page is loaded. dropdownlist should contain the country list from country table

View 7 Replies

Web Forms :: Binding DroupDownList / Bind Country Names Along With Country Flag?

Apr 3, 2010

In My project I have DoupDownList(ddl). In my ddl in need to bind country names along With Country Flag..So Can Any One Help Me In thi issue...Country Name And Country Flag Bouth i need to Bind in my ddl

View 5 Replies

Web Forms :: Populate The Dropdownlist1 With Country And Dropdownlist2 With City Of That Country From Web

Dec 3, 2010

I want populate the dropdownlist1 with Country and dropdownlist2 with City of that Country from web

Is there a place on web where we can get a list of countries and cities handy, and then populate into our dropdownlists in ASP.net page.

View 2 Replies

State Management :: How To Create Each Visitor To A Webpage

Jun 20, 2010

whenever any internet user visit any site on the world wide web, a session is created by the site for that useram i right? or is the session created by the iis on webserver?and this sessionwhat is it, yes i know session variables and how used them, but never understood what is this sessionwhat information does it have

View 6 Replies

Web Forms :: Display The Data Using Gridview Like Whenever Change The Country In Ddl It Should Display The Relevant Data According To The Country?

May 3, 2010

i am displaying various countries names in my dropdownlist and i want to display the data using gridview like whenever i change the country in my ddl it should display the relevant data according to the country??below is my code but i am unable to see any data whenever i change the country in my ddl gridview is not appearing??

[Code]....

View 16 Replies

Getting Info About The Visitor?

Nov 14, 2010

in PHP, I can know these info for the visitor: IP Address. IP HostName. Natted IP Address. Natted IP HostName. User-Agent (Web Browser, OS version, framework, infopath, etc...) Web REQUEST. Web Referrer. Language. DateTime. How can I know that in asp.net? And what additional info can I know using asp.net? And how can I know if the visitor have special software installed?

View 3 Replies

Web Forms :: What's The Best Way To Track Visitor Ip

Dec 3, 2010

I'm trying to write an application that allows a visitor to use our service for 7 days. After 7 days, they will no longer be able to use it unless they sign up. What's the best way and the most accurate way to track it without collecting their credit card information? I'm trying to use the following code to track visiotr's ip. But I'm not sure if people are able to change their ip address or using a proxy server that will go through.

HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]

View 13 Replies

Understand Whether The Visitor Is Googlebot Or Not ?

Feb 1, 2011

ow to understand whether the visitor is Googlebot or not ? ASP.net 4.0 & C# I mean i want to understand that if the visitor is Googlebot or not.

View 2 Replies

Security :: Set A Visitor As Logged In?

Mar 27, 2011

I created my own register system with my own register form together with the asp.net login control

the user register and the data is sent to my custom table and I used a method that check if the user exists in my table and the asp.net login control display the correct result "if exists or not"

everything appears to work correctly but I cannot access pages that deny anonymous users with the configuration file.

View 3 Replies

Get Visitor IP On Load Balancing Machine?

Mar 25, 2010

We are having two load balancing server. In that we have hosted a asp.net 3.5 application right now we are using request userhostaddress to get visitor ip but it is giving load balancer ip instead of real ip.

View 3 Replies

What Is The Right Way To Count Total Visitor In A Website

Aug 14, 2010

I'm facing with an old problem that it made me confuse very much. So I need your advice to make sure that I've been using the right way. My demand is to count the number of visitor in my website, so I've coded in Global.asax file:

[Code]....

Then, I used variable Application["SiteHitCounter"] and Application[CurrentUsers"] in another C# behind code file to show them on web page.The problem I'm facing is that the website can't show right total visitor number as in my database when I publish it to shared host.

View 3 Replies

Capturing Website Visitor Name (ID) And Location?

Mar 3, 2010

I have an ASP.net/VB.net website, and I currently capture the visitor's IP address with the following code:

IPAddr = Page.Request.ServerVariables("HTTP_X_FORWARDED_FOR").

Does anyone know the corresponding code that can capture (1) the visitor's name (ID) and (2) location?

Note: I am trying to capture the true information from the visitor's computer, not false (proxy) information. As an example, the code:

"Page.Request.ServerVariables("REMOTE_ADDR")" produces a false (proxy) IP address.

View 9 Replies

How To Trace The Website Visitor Count

Feb 28, 2011

I need to implement the website visitor count Usercontrol.

View 3 Replies

Track Visitor History - Second Time

Jun 25, 2010

my project is visitortracking system in this we are tracking all of the visitors now i want to track the visitor history(second time)

View 1 Replies

Calculate The Time The Visitor Has Been On The Website?

Mar 14, 2010

how to calculate the time the visitor has been on the website?

View 3 Replies

Web Forms :: Track IP Address Of Visitor?

Mar 10, 2011

I have a HTML webpage and I want to display the I.P address of last 5 visitors who visited the webpage.

I want to display these five I.P address on the webpage itself.

View 5 Replies

How To Fetch Visitor Name Who Is Online In Website

Feb 1, 2014

I want to display all the user's name who is login to my websites..

So I can see them who is online.

View 1 Replies

Security :: How To Create Unique Login For Each Visitor

Jan 27, 2011

I am creating a site that will host my virtual resume and would like to set it up so the visitor would enter a simple code to advance past the default page. I am not looking to create a unique login for each visitor, I just want to control who sees the information online. I have used the web controls in visual studio express for for creating logins on other sites, which included additional support code like "User.Identity.IsAuthenticated == false" to redirect visitors on other sites but I am looking to see if there is a more simple way of handling this.

View 1 Replies

Security :: Track IP Address Of Website Visitor?

Sep 17, 2010

I would like to develop a web application in which I can track the details(IP address...etc) of my website visitors....using vb

to implement the above web application

View 1 Replies

Web Forms :: How To Calculate Each Visitor Time On The Website

May 7, 2010

I know google analytics can do it,but i need to store each user data on my own database - for various advanced reasons and want to manipulate it. Here are my series of questions

1)How do i calculate time (when the visitor visits the website the timer should start....and when the visitor closes the page on my ASP.NEt Website timer should stop...so collecting his timespan to visit the website(when the visitor closes the page how should i make timer stop....and make an entry of his visit into the database....tricky...but i know there is a way out but how???).

2) I neede to know from which country the user came from...I know to collect the IP address but how could we find out which country the user came from..???

3)the next thing i need to know is..I want to display reports on my ASP.NEt Website of all visitor information,country,date time he visited and which technology i can use...crystal reports will be fine for me...or should any other.

4) i need to make it look like google analytics and make it super fast ...so my website visitors shouldnt wait too long..

View 4 Replies

Execute An External Application Such That Each Visitor Gets Isolated?

Jul 21, 2010

Actually I don't know whether my question is related to this thread.

I want to create a web application using ASP.NET MVC 2.

For simplicity, let my scenario be as follows:

A visitor is allowed to submit a text file and get a pdf output from the server.

There is an Adobe-Acrobat-like application, that can convert text to pdf, running on my server.

My question is how to execute the converter such that each visitor submitting files cannot interfere with others?

Should I make an instance of the converter for each visitor?

View 4 Replies

Web Application - How To Implement Online Payment For Visitor

Jun 18, 2012

i am working in a web application that should allow online payment to its visitor, and how to implement online payments in a asp.net web application.

View 1 Replies

Web Forms :: How To Save File To Server Rather Than Visitor Machine

Apr 13, 2010

i have get the piece of code from www.aspsbippets.com

protected void ExportToWord(object sender, EventArgs e)
{
//Get the data from database into datatable
string strQuery = "select CustomerID, ContactName, City, PostalCode" +
" from customers";
SqlCommand cmd = new SqlCommand(strQuery);
DataTable dt = GetData(cmd);
//Create a dummy GridView
GridView GridView1 = new GridView();
GridView1.AllowPaging = false;
GridView1.DataSource = dt;
GridView1.DataBind();
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition",
"attachment;filename=DataTable.doc");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-word ";
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridView1.RenderControl(hw);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
}

this code create word documnet and automatically downloaded to visitor machine, how i can save it on server rather than visitor machine?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved