asp.net c#数据库还原
public partial class shujuku_huanyuan : System.Web.UI.Page
{
SqlConnection conn = new SqlConnection(@"server=HUAZD-33\XXD33;uid=sa;pwd=111111;database=master;");
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
SqlConnection sqlConn = SqlConnections.GetSQLConnection();
string shujuku = sqlConn.Database;
this.Text1.Value = shujuku;//备份数据库路径
}
}
protected void btnsearch_ServerClick(object sender, EventArgs e)
{
ArrayList arraylistsqls = new ArrayList();
string path1 = Request["FileUpload1"].ToString().Trim(); //this.FileUpload1.FileName.ToString().Trim();
string shujukuming = this.Text1.Value.ToString().Trim();
if (System.IO.File.Exists(path1))
{
}
else
{
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('该路径下的备份文件不存在,请重新选择!');</script>");
return;
}
相关文档:
用c#给PDA做了一个PC端的通讯程序,需要保存两个参数。用Delphi时,是保存在ini文件中,c#读写XML比较方便,就用xml文件来保存了。
class CXmlClass
{
private string XmlFilePath;
/// <summary>
/// 下载到PDA的TXT文件路径
/// </summary>
......
Request.ServerVariables["Url"]
返回服务器地址
Request.ServerVariables["Path_Info"]
客户端提供的路径信息
Request.ServerVariables["Appl_Physical_Path"]
与应用程序元数据库路径相应的物理路径
Request.ServerVariables["Path_Translated"]
通过由虚拟至物理的映射后得到的路径
Request.ServerVariables ......
从来都很少写博,现在开始写写,方便自己用的时候不用搜索,或许还可以帮助到别人,何乐而不为呢?呵呵。
注意事项一:如果页面点击按钮无法触发验证控件的作用时,解决办法如下:
c:\WINNT\Microsoft.NET\Framework\v1.1.4322
1.开始菜单-->运行cmd
&nbs ......
静态变量
当我们编写一个类时,其实就是在描述其对象的属性和行为,而并没有产生实质上的对象,只有通过new关键字才会产生出对象,这时系统才会分配内存空间给对象,其方法才可以供外部调用。
有时候,我们希望无论是否产生了对象或无论 ......