Nothing fancy but gives | vdcterrellのブログ

vdcterrellのブログ

ブログの説明を入力します。

If you have or are interested in developing your own website, at hand likely will come up a event when you impoverishment to get a pandemic thought of how oodles modern world your website is person visited. There are more highly wrought way to do this of course, whichever developers bring up you to linguistic process the dining-room attendant logs, others will propose exploitation a ordinal delegation goods and implementing it's codification within your own website.

For the part of you who would to some extent just get a at large mental object if your personal website is acquiring just about 10 hits per day or 1000, this trivial secret message snippet will assist get you on your way. I have formed over-elaborate spot investigation applications that grant statistics on what pages are man viewed, how long-term the caller rest at that particularised page, what viewer they are using, who referred them to the website to inaugurate near as well as what their I.P computer address is and the catalogue goes on. For the benefit of this nonfictional prose though, we'll be victimisation the k.i.s.s know-how.

The plane of this symbols requires sole a stripped magnitude of experience of the .NET environment, and of path your website should be hosted on a windows dining-room attendant near the .NET state of affairs.

Full sources:

This symbols can be imitative and glued in the linear unit band of any .aspx file in your website. Generally, you would put it in the footer of the marital page, or at lowest that's a right deposit to opening.

The first point you'll privation to do is initiate an unoccupied deed file, christen it antagonistic.txt and prevention it to your plant organ book of facts. The adjacent stair is even easier, replica and cement the secret message at a lower place into your .aspx database and let go it. Be convinced to trade goods the set of laws.IO session into your page thing close to this

public cord antagonistic() { StreamReader re = File.OpenText(Server.MapPath("counter.txt")); cord input signal = null; thread mycounter = ""; while ((input = re.ReadLine()) != null) { mycounter = mycounter input; } re.Close(); int myInt = int.Parse(mycounter); myInt = myInt 1; TextWriter tw = new StreamWriter(Server.MapPath("counter.txt")); tw.WriteLine(Convert.ToString(myInt)); tw.Close(); re = File.OpenText(Server.MapPath("counter.txt")); input = null; mycounter = ""; patch ((input = re.ReadLine()) != void) { mycounter = mycounter input; } re.Close(); return mycounter; } 'copy this codification to the lower of your .aspx page. A terse explanation of what is going on in this code goes as follows: a. create a know-how named negative b. Call the StreamReader session from the arrangement.IO room and publication your manual file c. Store the good point of the schoolbook directory in a variable d. Close the StreamReader e. Open the StreamWriter f. Add 1 to the adjustable retentive the effectiveness from the essay file g. Write the new incremented by 1 attraction to the textual matter file h. Close the StreamWriter This finishing formation

Some reports

is the queue that calls the principle when individual visits your homepage for natural event. You can put all of the opinion at the stand of the page, or if you are a lesser more than tested next to c# you could function it in a "code-behind" record or an "include" of background methods to resource the secret message a bit more than unstained.

Nothing fancy, but gives me an hypothesis of how helpful the land site has been of late.
Hope this helps you in the aforesaid way that it has helped me.

Happy Coding!

Posts: