Google [站内搜索]

分类: Web编程预览模式: 普通 | 列表

多线程:线程的优先级

计算机中经常会有多个任务同时运行,其中总有一些看起来更紧急,更需要优先完成。比如我们现在有两个任务,一个任务是下载一部电影,另一个任务是检测用户的输入。显然及时响应用户操作应具有更高的优先级,因为我们不能让用户等得太久。

线程的优先级可以通过Thread类Priority属性设置,Priority属性是一个ThreadPriority型枚举,列举了5个优先等级。

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4136

ASP.NET动态加载主题示例

1.先制作两个主题Default和Blue

App_Themes\Default\Default.skin:
<asp:TextBox runat="server" BorderWidth="1px" BorderColor="Red" ForeColor="Red"></asp:TextBox>

App_Themes\Blue\Blue.skin:

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5256

ASP.NET为页面某个控件单独设置外观

有时我们给一个ASP.NET页面指定使用了一个主题后,又想单独为某个控件设置外观(不使用默认外观),这时可采用的方法有两种:一是使用命名的控件外观,二是在@Page指令中使用StylesheetTheme属性来代替常用的Theme。下边使用具体实例说明下两种方法的使用:

1.使用命名的控件外观

App_Themes\Default\Default.skin:

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4372
T-SQL:

Create PROCEDURE Pro_MoreResult
AS
    --第一个结果集

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 5137

C#中String和string的区别

·string是C#中的类,String是.Net Framework的类(在C# IDE中不会显示蓝色)。
·C# string映射为.Net Framework的String。
·如果用string,编译器会把它编译成String,所以如果直接用String就可以让编译器少做一点点工作。
·如果使用C#,建议使用string,比较符合规范。
·string始终代表 System.String(1.x) 或 ::System.String(2.0),String只有在前面有using System;的时候并且当前命名空间中没有名为String的类型(class、struct、delegate、enum)的时候才代表System.String。

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3434

使用ildasm查看MSIL代码

微软中间语言 (MSIL) 是一种语言,是许多编译器(C#、VB.NET等)的输出。ILDasm (中间语言反汇编器)程序和.Net Framework SDK(FrameworkSDK\Bin\ildasm.exe)打包在一起,让用户以人可阅读的格式查看MSIL代码。通过该工具,我们可以打开任何.net可执行文件(exe或dll)并查看其MSIL代码。下边我们来看看怎么使用:

1.在VS2008中新建一个Windows窗体应用程序,输入如下代码后生成解决方案:
private void Form1_Load(object sender, EventArgs e)
{

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6681

int i=0;i=i++;结果解析

int i=0;
int j=i++;

对于上边的代码,大家都知道最终j=0,i=1,之前为了方便记忆,记它的口诀是先赋值再递增,以区别于j=++i(先递增再赋值),所有理解中就有了这么一个执行顺序:

int i=0;

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 6009

select列表项选中

在对内容进行编辑的时候,有些内容是以列表(select)的形式显示的,为了方便编辑,我们希望上次提交的列表项能设置为选中项,以前ASP 中经常这么写:

<select name="accredit" id="accredit" style="width:100px">
    <option value="共享软件" <% If addRow("accredit")="共享软件" Then Response.Write("selected") %>>共享软件</option>
    <option value="免费软件" <% If addRow("accredit")="免费软件" Then Response.Write("selected") %>>免费软件</option>

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 3913
建立池连接可以显著提高应用程序的性能和可缩放性。SQL Server .NET Framework 数据提供程序自动为 ADO.NET 客户端应用程序提供连接池(MSDN)。

Opening a database connection is a resource intensive and time consuming operation. Connection pooling increases the performance of Web/windows applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections. When a new connection requests come in, the pool manager checks if the pool contains any unused connections and returns one if available. If all connections currently in the pool are busy and the maximum pool size has not been reached, the new connection is created and added to the pool. When the pool reaches its maximum size all new connection requests are being queued up until a connection in the pool becomes available or the connection attempt times out.
Connection pooling behavior is controlled by the connection string parameters. Please look into MSDN documents in the reference link if you want to know further information.

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4467

"超时时间已到"解决方案

联盟平台周期性的打不开,查了下日志,错误原因都为:

引用内容 引用内容
Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.

超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。

查看更多...

分类:Web编程 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 4763