易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 : c#

Paging long articles in ASP.NET using C#

Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that gets posted to a database.
The Regular Expression Split() method returns a one-dimensional zero-based array containing a number of substrings, so it is perfect for this job. What I want to do is take an article (which is a string) and divide it into substrings. In order to do this, I need a delimiter, and I use <!--pagebreak-->. As I enter the article into the database, I place <!--pagebreak--> at the points I want to break the article.
Then, having extracted the article from the database, I pass it to the following static method which I have in a utility class:
public static string PageArticle(string Article)
{
string Output;
string ThisPage = HttpContext.Current.Requ ......

Paging long articles in ASP.NET using C#

Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that gets posted to a database.
The Regular Expression Split() method returns a one-dimensional zero-based array containing a number of substrings, so it is perfect for this job. What I want to do is take an article (which is a string) and divide it into substrings. In order to do this, I need a delimiter, and I use <!--pagebreak-->. As I enter the article into the database, I place <!--pagebreak--> at the points I want to break the article.
Then, having extracted the article from the database, I pass it to the following static method which I have in a utility class:
public static string PageArticle(string Article)
{
string Output;
string ThisPage = HttpContext.Current.Requ ......

C# 连结access

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
/// <summary>
/// DB 的摘要描述
/// </summary>
public class DB
{
    OleDbConnection conn = null;
    OleDbCommand cmd = new OleDbCommand();
 public DB()
 {
  //
  // TODO: 在此加入建構函式的程式碼
  //
        string dbname = System.Web.HttpContext.Current.Server.MapPath("DB_App/netData.aspx");
        string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+dbname;
        conn = new OleDbConnection(conStr);
 }
    public OleDbConnection getConn()
    {
 &nbs ......

ASP.NET中Excel操作类C#版

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office.Interop;
using Microsoft.Office.Core;
namespace ExcelEdit
{
/// <summary >
/// ExcelEdit 的摘要说明
/// </summary >
public class ExcelEdit
{
public string mFilename;
public Excel.Application app;
public Excel.Workbooks wbs;
public Excel.Workbook wb;
public Excel.Worksheets wss;
public Excel.Worksheet ws;
public ExcelEdit()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public void Create()//创建一个Excel对象
{
app = new Excel.A ......

ASP.NET中Excel操作类C#版

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office.Interop;
using Microsoft.Office.Core;
namespace ExcelEdit
{
/// <summary >
/// ExcelEdit 的摘要说明
/// </summary >
public class ExcelEdit
{
public string mFilename;
public Excel.Application app;
public Excel.Workbooks wbs;
public Excel.Workbook wb;
public Excel.Worksheets wss;
public Excel.Worksheet ws;
public ExcelEdit()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public void Create()//创建一个Excel对象
{
app = new Excel.A ......

错误记录:ASP.NET(C#)中未能加载自定义类型(类)

环境:ASP.NET(C#),Visual Studio 2010。
提示:未能加载类型“EMS.App_Code.PersonalInfo”。如果该类型位于App_Code文件夹中,请检查它是否已编译。如果该类型位于已编译的程序集中,请检查该程序集是否被该项目引用。
处理:
自己做得一个小程序,取名EMS,并在App_Code文件夹下建立了类PersonalInfo、SalarInfo。 ......

错误记录:ASP.NET(C#)中未能加载自定义类型(类)

环境:ASP.NET(C#),Visual Studio 2010。
提示:未能加载类型“EMS.App_Code.PersonalInfo”。如果该类型位于App_Code文件夹中,请检查它是否已编译。如果该类型位于已编译的程序集中,请检查该程序集是否被该项目引用。
处理:
自己做得一个小程序,取名EMS,并在App_Code文件夹下建立了类PersonalInfo、SalarInfo。 ......

在C#中运用 SQLite

  SQLite 是一个嵌入式的联系数据库系统,运用十分广泛。在一些数据量不大的运用 程序中,假如运用 SQLite可以极大的降低部署时的工作量。 要在C#中运用 SQLite也很基本,只要找一个C#的wrapper就可以了,例如,我运用的就是来自
  http://sqlite.phxsoftware.com/  的一个dll,System.Data.SQLite. 下载下来的文件是SQLite-1.0.65.0-setup.exe。只要安装一下就可以运用了,特别方便。该程序契合 ADO.NET的规范,并且支撑 Visual Studio的可视化表设计器。
  打开Visual Studio 2008,新建一个Console Application,为此项目添加System.Data.SQLite的引用。添加一个数据库连接,此时可以发觉,新建连接中有了一个SQLite Database Connection,挑选此类型的数据连接,并且新建一个文件,
  test.db3. 接下来在新数据库中添加一张表。
  下面开始为此表建立一个Data Access类,以展示在C#中如何 运用 SQLite,可以想象,和操作其他数据库是几乎一样的,感谢ADO.NET的功劳。
  最先是一个实体类 Book.cs:
public class Book
    {
        private int id;
        private string bookName;
        private decima ......

ASP.NET(C#)实现一次性上传多张图片(多个文件)

在做asp.net的Web开发的时候,我们经常会遇到一次性上传多个文件的需求。通常我们的解决方法是固定放多个上传文件框,这样的解决办法显然是不合理的,因为一次上传多个,就意味着数量不确定。因此我们就要让这些文件上传框动态添加,下面我以我做的一个图库管理中的上传图片的功能为例
先看效果:
打开的初始界面:
默认是上传一个图片,但当我们点“增加图片”按钮时可以实现选择多个图片及其描述同时上传,本功能限制一次最多只能上传8张,且每张图片大小不超过1M,这个大家可根据实际情况更改!
如图:
下面来看实现过程:
第一步,使用javascript代码实现动态添加文件上传框和描述文本框,关键代码如下:
<script type="text/javascript">
        var i=1
        function addFile()
        ...{
    
         if (i<8)
            ...{var str = '<BR> <input type="file" name="File ......

ASP.NET(C#)实现一次性上传多张图片(多个文件)

在做asp.net的Web开发的时候,我们经常会遇到一次性上传多个文件的需求。通常我们的解决方法是固定放多个上传文件框,这样的解决办法显然是不合理的,因为一次上传多个,就意味着数量不确定。因此我们就要让这些文件上传框动态添加,下面我以我做的一个图库管理中的上传图片的功能为例
先看效果:
打开的初始界面:
默认是上传一个图片,但当我们点“增加图片”按钮时可以实现选择多个图片及其描述同时上传,本功能限制一次最多只能上传8张,且每张图片大小不超过1M,这个大家可根据实际情况更改!
如图:
下面来看实现过程:
第一步,使用javascript代码实现动态添加文件上传框和描述文本框,关键代码如下:
<script type="text/javascript">
        var i=1
        function addFile()
        ...{
    
         if (i<8)
            ...{var str = '<BR> <input type="file" name="File ......
总记录数:642; 总页数:107; 每页6 条; 首页 上一页 [36] [37] [38] [39] 40 [41] [42] [43] [44] [45]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号