当我们刷新页面时,应该重新引用引号(已更改) [英] When we refresh the page the quotes should be refeshed(Changed)

查看:90
本文介绍了当我们刷新页面时,应该重新引用引号(已更改)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想在我的ASP.NET网站中添加明智的引号,并且每次刷新页面时都应该更改。



你可以看到我想到使用它的链接。它在左边的Wise Quotes。



http://www.indiabix.com/networking/tcp-ip/003004 [< a href =http://www.indiabix.com/networking/tcp-ip/003004target =_ blanktitle =New Window> ^ ]



如何在我的ASP.NET网站上获取此内容.....

Suppose I want to add wise quotes in my ASP.NET website and it should change each time when page is refreshed.

you can see the link from where I thought of using it.It is on left side Wise Quotes.

http://www.indiabix.com/networking/tcp-ip/003004[^]

How can I get this in my ASP.NET website.....

推荐答案

每次网页都可以生成一个随机数被调用,并使用该数字从源(即数据库,文本文件或其他一些网站)中提取Qoute。



您可以为每个Qoute分配一个ID,然后生成一个随机数,该数字将从0开始,并且将超过QuoteID的最大数量'有。



You can generate a Random number each time the web page is called, and use that number to extract the Qoute from the source (i.e. Database, Text File, or some other website).

You can assign an ID to each of the Qoute, and then generate a Random number, that would start from 0 and would span upto the maximum number of the QuoteID you're having.

// Add one because it generates randoms equal to number passed - 1
Random random = new Random(maxQouteId + 1);

// use this random number to extract the random Qoute





阅读更多关于Randoms 在MSDN上 [ ^ ]。


这篇关于当我们刷新页面时,应该重新引用引号(已更改)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆