ASP.NET数据库导入Excel
StringWriter sw = new StringWriter();
sw.WriteLine("访问购买率");
sw.WriteLine("排行\t商品名称\t人气指数\t购买次数\t访问购买率");
int i = 0;
foreach (ProductSaleInfo productSale in productSaleList)
{
i = i + 1;
sw.WriteLine(i.ToString() + "\t" + productSale.Name.ToString() + "\t" + productSale.ViewCount.ToString() + "\t" + productSale.SaleCount.ToString() + "\t" + XWXCommon.ProductBuyRate(productSale.ViewCount.ToString(), productSale.SaleCount.ToString()));
}
sw.Close();
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.AppendHeader("Content-Disposition&
相关文档:
///C#中的媒体播放类
using System;
namespace ConfigTools
{
/// <summary>
/// PlayClass 的摘要说明。
///原作CSDN,经本人稍加修改
/// </summary>
public class PlayClass
{
public PlayClass()
{
......
本系列文章基于ASP.NET MVC Preview5.
Controller是MVC中比较重要的一部分。几乎所有的业务逻辑都是在这里进行处理的,并且从Model中取出数据。在ASP.NET
MVC
Preview5中,将原来的Controller类一分为二,分为了Controller类和ControllerBase类。Controller类
继承自ControllerBase类,而ControllerBase实现是了ICont ......
测试的url地址是http://www.test.com/testweb/default.aspx, 结果如下:
Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/defa ......
当我们想要从网上下载文件时,通常的做法是在服务器上的某个目录下生成一个文件。
protected void DownloadFile(string filename)
{
string saveFileName = "test.xls";
int intStart = filename.LastIndexOf("\\") + 1;
saveFileName = filename.Substring(intStart, filename.Lengt ......
This server-based method is documented in the Visual Studio help files. Open the Help Index, and enter PrintToPrinter in the "Look for:" box. The syntax for this method is:
Report.PrintToPrinter(<copies as int>, <collated as True/False>, <startpage as int>, <endp ......