推荐:asp.net编程中实现 MD5 加密现在制作的web系统需要用到加密 依旧选择md5吧(其实我也就用过md5^_^) 找到了两种实现 方案一: /**//// /// 用md5加密 ///
备份SqlServer数据库
核心技术:
using System.Data.SqlClient; using System.IO; string SqlStr1 = "Server=(local);DataBase=master;Uid=sa;Pwd="; string SqlStr2 = "Exec sp_helpdb"; string SqlStr1 = "Server=(local);database='" this.DropDownList1.SelectedValue "';Uid=sa;Pwd="; string SqlStr2 = "backup database " this.DropDownList1.SelectedValue " to disk='" this.TextBox1.Text.Trim() ".bak'"; |
1.前台
<table> |
2.后台
using System.Data.SqlClient; public partial class _Default : System.Web.UI.Page |
还原SqlServer
核心技术:
string SqlStr1 = "Server=(local);database='" this.DropDownList1.SelectedValue "';Uid=sa;Pwd="; string SqlStr2 = "use master restore database " dbname " from disk='" path "'"; |
1.前台
<table> <tr> <td style="width: 100px; height: 21px"><span style="font-size: 9pt">操 作 数 据 库</span></td> <td><asp:DropDownList ID="DropDownList1" runat="server" Font-Size="9pt" Width="124px"></asp:DropDownList></td> <td style="width: 100px; height: 21px"></td> </tr> <tr> <td style="width: 100px"><span style="font-size: 9pt">操 作 数 据 库</span></td> <td style="width: 100px"><asp:FileUpload ID="FileUpload1" runat="server" Font-Size="9pt" Width="190px" /></td> <td style="width: 100px"> </td> </tr> <tr> <td colspan="3"><asp:Button ID="Button1" runat="server" Font-Size="9pt" OnClick="Button1_Click" Text="还原数据库" /></td> </tr> </table> |
using System.Data.SqlClient; public partial class _Default : System.Web.UI.Page protected void Button1_Click(object sender, EventArgs e) |
分享:ASP.NET常用的三十三种实用代码1. 打开新的窗口并传送参数: 传送参数: response.write("<script>window.open(’*.aspx?id=" this.DropDownList1.SelectIndex &
新闻热点
疑难解答
图片精选