Web Forms :: How To Get IP Of Users System Machine When Visits Page
May 17, 2013How I can get the IPS of all the computers through which users are accessing my website.
View 1 RepliesHow I can get the IPS of all the computers through which users are accessing my website.
View 1 RepliesI have a background set of images that is called randomly.It changes each time a user opens a new page and refreshes the same page.Not 100% of what I want.
Ideally I would like a random image to be shown each time a user comes to the site but not on every page.
Is there a way to set the image per the session a users visits the site instead of each page?
Current code
SqlConnection connection = null;
connection = new SqlConnection(ConfigurationManager.ConnectionStrings["PSI_DB_1ConnectionString"].ConnectionString.ToString());
connection.Open();
int id = Convert.ToInt32(Request.QueryString["id"]);
string SQLquery ="";
if (id == 0)
{
SQLquery = "Select Top 1 ImageData,ImageType from WebBGImages ORDER BY NEWID()";
}
else
{
SQLquery = string.Concat("Select ImageData,ImageType from WebBGImages where ImageID=",id);
}
SqlCommand Cmd = new SqlCommand(SQLquery, connection);
SqlDataReader Dr = Cmd.ExecuteReader();
if (Dr.HasRows)
{
while (Dr.Read())
{
Byte[] bytes = ((Byte[])Dr["ImageData"]);
Response.Buffer = true;
Response.Charset = "";
Response.ContentType = Dr["ImageType"].ToString();
Response.BinaryWrite(bytes);
Response.End();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(bytes);
}
}
Response.Flush();
Response.End();
Cmd.Dispose();
connection.Close();
connection.Dispose();
What I want is I that I want to keep track of number of visits per page and average time spent on each page and the site. I don't want to use any third (3rd) party tool. How to achieve this with minimum code.
View 5 RepliesI want to count total unique visits in a particular page of my website using ASP.Net, C#. How i will do it
View 1 RepliesI want to store a users dialect in a cookie on his machine, and then look it up before loading the version of my web app. What is the code to do that.
View 12 Repliesi Have multiple File upload. press Uploaded button it will store on sever temp folder. those details are in List on our program.
when i have press the submit then only those listed files fetch form server-temp-Folder and replace in server-secified- folder.
i want to make those list class save into client location for not affted by some of other updates.
how cn i store the custome list in client memory
i have a asp.net web with vb code and sql database. i am willing to store the details of the users as ip,computer name and time of using the web is it possible.
View 1 Repliesim tryin to figure how to do this, i have some web page and i want to allow only visits from facebook to see that page and anyone else will direct to other page how can i trace users that came from facebook to my site and direct them to special page and others to diffrent page?
View 13 RepliesDoes anyone know how I can get the IP of a users machine using c#? Possible?
View 3 RepliesI have an ASP.NET application where View.aspx page will display the details of each products in a shopping cart.The page displays dynamic data(Ex: For each product id,the content will be different).Now i want to track the unique page views of each product.What are the best solutions to approach this problem ? I am already using google analytics.But i wanna custom solution/code for my web app,so that i can know how many hits came for each product
View 2 Repliesi am wishing to count total number of visits on any particular page with also the ability to work when IIS reset is done, i think by using database we can solve it.
how to count total number of visits on any particular page?
My intention is to give the user a flexible user control on a master page that does the following:
When navigating, a child page will pass the URL (with querystring) and PageTitle to the user control. The user control will take those two parameters and insert them as a "breadcrumb" object at first index of a List<breadcrumb> collection
This part works fine through the use of a Repeater with a LinkButton contained in an ItemTemplate. The user sees each of the pages he has been visiting in descending order, the provided benefit is a quick way to re-open records they have recently modified or created.
The part I'm having trouble handling is what happens when the user clicks the LinkButton, which is that the child page adds a new reference to the URL at the beginning of the List<> collection and I cannot seem to control the behavior of removing the LinkButton before it gets re-created. What I've tried doing is:
List<>.RemoveAt(RepeaterCommandEventArgs.Item.ItemIndex);
Repeater1.Controls.Clear();
Repeater1.DataSource = List<>;
Repeater1.DataBind();
While that should work, my CreateBreadCrumb(string url, string title) function gets called by the child page before the UserControl detects the Repeater1_ItemCommand event, so in effect it appears that the wrong ItemIndex is being used for removal.
How to save a text into a specific folder of computer(in document) by default, when the user clicks yes(for,Do you want to save the file?) to save a file into his computer? If the folder doesnot exist create and save the textfile?
View 1 Repliesgetting user's local machine drives in asp.net
When i use the code below
foreach (DriveInfo drive in DriveInfo.GetDrives())
{ Console.WriteLine(drive.Name);}
after deploying in server it get servers local drives
i am developing one application in mvc my problem is after login it will redirect to some page if i copy url and paste it in another browser its showing error in application but i need to display home page?
how to solve this ?
ASP.Net Page layout is not displaying properly in QA machine but is displaying correctly in Dev Machine. What could be the issue? We are using ASP.Net 2.0
View 1 Replies1. ASP.Net WEB server.
2. I have PC, on which file to copy to device is located, with Active Sync installed and IE running which has a page in that IE has rendered by server #1.
3. I have a DEVICE connected to desktop #2 via AS.
I would like to copy file from a local machine to the device which is connected to this machine. My application is located in a webserver.
I need to save a file into special folder.
if (TextBox1.Text == s)
{ MessageBoxResult mbr = MessageBox.Show(this, "Do you want to save file?", "saved", MessageBoxButton.YesNoCancel); // if (mbr == MessageBoxResult.Yes) // { // //string path = string.Empty; // string path; // path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "abcFile"; // if (!Directory.Exists(path)) // Directory.CreateDirectory(path); // }
It creates a folder abc if it doen't exist, i need to save s where s is a textfile.
Is there a way in ASP.Net to find out the browser and operating system of the user?
View 1 RepliesI want to know which pages users visit, and I want to register them
View 2 Repliesin my aspx.vb page i have written
Label1.Text = Me.Page.User.Identity.Name
when i do view in browser (without publishing to any server) i see label's text as
abcxyz which is correct
but when i publish it, i dont see any text . I have made setting IIS to allow anonymous users so that anyone can open the wesite and see their computer login id
like abcxyz
We have a Page Method on a web page using ASP .Net. We tried to put in a trace statement using both System.Diagnostics and System.Diagnostics.Debug. In Visual Studio 2008, the break point is not even hit for the line, but other break points on other lines are hit.There is no output from either method that we can see.
There is also a Global.asax error catcher that works fine in other cases, but in the Page Method is not being catched.why a Page Method and System.Diagnostics do not play well together?
I have a ASP.Net web application that generates files. These files need to be stored on the client machine.
The web application should ask the user for a directory on the client machine where the files are to be stored. How do I achieve this?
Clicking the save button on my webform that's on our dev server:
http://DevServer/Page.aspx
Posts back to the same page on my local machine:
http://LocalMachine/Page.aspx
How does the DevServer even know my computer exists? I haven't hardcoded any URLS in my code.
I wish to log the user name and which page they visited.
Is there a quick way to do that in ASP.Net ?