MesageBox JS Alert
string script = "alert('New Password is Created');\n";
Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", script, true);
****************************************************************************************************************************************************************************************計算程序運行時間:
using System.Diagnostics;
private Stopwatch stw = new Stopwatch();
private void Form1_Load(object sender, EventArgs e)
{
stw.Start();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dr = MessageBox.Show("真的要退出?", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
stw.Stop();
MessageBox.Show("程序共運行時間:" + stw.Elapsed.Seconds.ToString() + "." + stw.Elapsed.Milliseconds.ToString() + "秒");
e.Cancel = false;
}
else
{
e.Cancel = true;
}
}
**************************************************************************************************************************************************************************************
Debug Output in the class
1, go to Debug --> options & Setting --> Redirect all output Window text to the Immediate window
System.Diagnostic.Debug.WriteLine("stuff");
**************************************************************************************************************************************************************************************
如何增加一些非.net控件的屬性: 以Ifream爲例子
http://stackoverflow.com/questions/3945176/talking-to-iframe-from-asp-net-code-behind
MyIframe.Attributes.Add("src", "http://www.facebook.com");
*************************************************************************************************************************************************************************************