使用实例:
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
urlPath = Server.MapPath("~/file/");
fileInfo();
}
}
/// <summary>
/// 文件操作
/// </summary>
使用实例:
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
urlPath = Server.MapPath("~/file/");
fileInfo();
}
}
/// <summary>
/// 文件操作
/// </summary>
使用实例:
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
urlPath = Server.MapPath("~/file/");
encryptInfo();
}
}
/// <summary>
/// 字符串加密解密
/// </summary>
Android开发学习
Android开发中,会需要对自己定义自己的弹出提示层,不使用系统默认的。
前端页面代码:
<style type="text/css">
    #DataList1 { border:solid 1px #ff0000; width:600px;}
    #GridView1 { border:solid 1px #00ff00; margin-top:10px; width:600px;}
    .Repeater { border:solid 1px #0000ff; margin-top:5px; width:600px;}
</style>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None"
    UseAccessibleHeader="False" OnRowDataBound="GridView1_RowDataBound">
    <Columns>
        <asp:TemplateField HeaderText="站点">
            <ItemTemplate>
                <asp:Label ID="UserSite" runat="server" Text='<%#Bind("UserSite") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center"/>
        </asp:TemplateField>
        <asp:BoundField DataField="UserName" HeaderText="姓名" />
        <asp:BoundField DataField="UserAge" HeaderText="年龄" />
        <asp:BoundField DataField="UserSex" HeaderText="性别" />
    </Columns>
</asp:GridView>使用C#实例:
前端页面代码:
<style type="text/css">
    #DataList1 { border:solid 1px #ff0000; width:600px;}
    #GridView1 { border:solid 1px #00ff00; margin-top:10px; width:600px;}
    .Repeater { border:solid 1px #0000ff; margin-top:5px; width:600px;}
</style>
<asp:DataList ID="DataList1" runat="server">
    <ItemTemplate>
        <table border="0">
            <tr>
                <td>
                    <%#Eval("UserSite")%>    <%#Eval("UserName")%>
                </td>
                <td>
                    <%#Eval("UserAge")%>    <%#Eval("UserSex")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:DataList>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None"
    UseAccessibleHeader="False" OnRowDataBound="GridView1_RowDataBound">
    <Columns>
        <asp:TemplateField HeaderText="站点">
            <ItemTemplate>
                <asp:Label ID="UserSite" runat="server" Text='<%#Bind("UserSite") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center"/>
        </asp:TemplateField>
        <asp:BoundField DataField="UserName" HeaderText="姓名" />
        <asp:BoundField DataField="UserAge" HeaderText="年龄" />
        <asp:BoundField DataField="UserSex" HeaderText="性别" />
    </Columns>
</asp:GridView>
<asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
        <table border="0" class="Repeater">
            <tr>
                <td>
                    <%#Eval("UserSite")%>    <%#Eval("UserName")%>
                </td>
                <td>
                    <%#Eval("UserAge")%>    <%#Eval("UserSex")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:Repeater>使用C#实例:
使用实例:
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    { 
        verCodeInfo();
    }
}
/// <summary>
/// 验证码生成
/// </summary>
private void verCodeInfo()
{
    /*方法1*/
    VerCodeHelper v = new VerCodeHelper();
    Response.Write("<IMG alt=\"" + "" + "\" src=\"data:image/png;base64," + FileHelper.ImgToBase64String(v.Image) + "\" border=\"0\">"); //固定生成长度的验证码
    /*方法1*/
    
    /*方法2*/
    string chkCode = VerCodeHelper.MakeCode(5); //根据长度自动生成
    MemoryStream ms = VerCodeHelper.CreateCodeImg(chkCode);
    Response.ClearContent();
    Response.ContentType = "image/gif";
    Response.BinaryWrite(ms.ToArray());
    /*方法2*/
}类库信息:
使用实例:
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        urlPath = Server.MapPath("~/file/");
        qrCodeInfo();
    }
}
/// <summary>
/// 二维码生成
/// </summary>
private void qrCodeInfo()
{
    Response.Write("<IMG alt=\"" + "" + "\" src=\"" + "file/" + QrCodeHelper.getQrCodePath("https://www.zhengdecai.com/", "8", urlPath, "zhengdecai_qr.png") + "\" border=\"0\">" + " ");
    Response.Write("<IMG alt=\"" + "" + "\" src=\"" + "file/" + QrCodeHelper.getQrCodePath("https://www.zhengdecai.com/", "8", urlPath + "zhengdecai_logo.png", urlPath, "zhengdecai_qr_logo.png") + "\" border=\"0\">" + "<br />");
}类库信息:
使用实例:
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        urlPath = Server.MapPath("~/file/");
        barCodeInfo();
    }
}
/// <summary>
/// 图标生成
/// </summary>
private void barCodeInfo()
{
    Response.Write("<IMG alt=\"" + "" + "\" src=\"" + "file/" + BarCodeHelper.getBarCodePath("www.zhengdecai.com", "Code128B", urlPath, "zhengdecai_bar.jpg") + "\" border=\"0\">" + "<br />");
}类库信息:
使用实例:
private DataTable dt = new DataTable();
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
dt = new DataTable();
dt.Columns.Add("UserName");
dt.Columns.Add("UserAge");
dt.Columns.Add("UserSex");
dt.Columns.Add("UserSite");
DataRow dr = dt.NewRow();
dr["UserName"] = "郑德才";
dr["UserAge"] = "27";
dr["UserSex"] = "男";
dr["UserSite"] = "http://www.zhengdecai.com";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr["UserName"] = "旺旺";
dr["UserAge"] = "29";
dr["UserSex"] = "女";
dr["UserSite"] = "http://www.zhengdecai.cn";
dt.Rows.Add(dr);
dv = new DataView(dt);
urlPath = Server.MapPath("~/file/");
oWCChartInfo();
}
}
/// <summary>
/// 图标生成
/// </summary>
使用实例:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
flashInfo();
}
}
/// <summary>
/// 创建显示图像的标签
/// </summary>
当FTP搭建完成后,下次启动电脑或服务器后,FTP不能正常使用。
右键FTP网站,"管理FTP站点"-"启动"。
如果启动不了,出现“除非Microsoft FTP 服务(FTPSVC)正在运行,否则无法启动FTP站点。服务目前已停止”。

使用实例:
private User u = new User();
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
#region 基础数据
u = new User();
u.UserName = "郑德才";
u.UserAge = "27";
u.UserSex = "男";
u.UserSite = "http://www.zhengdecai.com";
urlPath = Server.MapPath("~/file/");
#endregion
sessionInfo();
}
}
/// <summary>
/// Session测试
/// </summary>
使用实例:
private User u = new User();
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
#region 基础数据
u = new User();
u.UserName = "郑德才";
u.UserAge = "27";
u.UserSex = "男";
u.UserSite = "http://www.zhengdecai.com";
urlPath = Server.MapPath("~/file/");
#endregion
cookieInfo();
}
}
/// <summary>
/// Cookie测试
/// </summary>
使用实例:
private User u = new User();
private string urlPath = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
#region 基础数据
u = new User();
u.UserName = "郑德才";
u.UserAge = "27";
u.UserSex = "男";
u.UserID = "http://www.zhengdecai.com";
urlPath = Server.MapPath("~/file/");
#endregion
cacheInfo();
}
}
/// <summary>
/// 缓存测试
/// </summary>
C#、Asp.Net中对XML文件进行操作,增、删、改XMl文件里面节点信息
public class XmlHelper
    #region 增、删、改操作==============================================        
    /// <summary>
    /// 追加节点
    /// </summary>
    /// <param name="filePath">XML文档绝对路径</param>
    /// <param name="xPath">范例: @"Skill/First/SkillItem"</param>
    /// <param name="xmlNode">XmlNode节点</param>
    /// <returns></returns>
当需要进行查询某个字符串的首字母缩写或者字符串的全拼,使用C#是可以实现的,但是我们还可以通过Sql函数,调用函数也可以实现,不过这种方法需要数据库连接,代码如下:
--获取字符串全拼
--获取字符串汉字首字母
在两个数据库进行同步或者对比的时候,需要对比两个数据库之间的差异,使用Sql语句进行对比分析,具体操作如下:
1、创建两个表(BackUp_TableInfo、BackUp_TableInfo1)来进行存储表结构信息,即表的所有字段信息,这里需要在两个数据库中都同时创建,也可以根据需要两个数据库中分别创建,Sql语句=
IIS搭建.Net网站的时候,都准备安装好,但是打开网站出现“服务器应用程序不可用”错误
错误代码:
服务器应用程序不可用
您试图在此 Web 服务器上访问的 Web 应用程序当前不可用。请点击 Web 浏览器中的“刷新”按钮重试您的请求。
管理员注意事项: 详述此特定请求失败原因的错误消息可在 Web 服务器的系统事件日志中找到。请检查此日志项以查明导致该错误发生的原因。
解决方法:
具体操作:
在安装Sql Server 2008时候,启动setup.exe时出现错误,错误代码如下:
/*
Microsoft <R> SQL Server 2008
未处理的异常:System.IO.FileNotFountException:未能加载文件或程序集“System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。系统找不到指定的文件。
错误代码:The 'Microsoft.Jet.OLEDB.12.0' provider is not registered on the local machine.
翻译后是:Microsoft.Jet.OLEDB.12.0的供应商不是在本地机器上注册。
未能找到OLEDB,需要下载“Microsoft Access 2010 数据库引擎可再发行程序包”,下载地址:https://www.microsoft.com/zh-cn/download/details.aspx?id=13255