例如在程式中進行以下的作業:
while(true) { //SELECT ID, Parent, Name FROM Table1 WHERE Parent=@ID }透過迴圈, 一次次地到資料庫查詢這個 Node 相關的 Parent/Child 資料.
while(true) { //SELECT ID, Parent, Name FROM Table1 WHERE Parent=@ID }透過迴圈, 一次次地到資料庫查詢這個 Node 相關的 Parent/Child 資料.
Response.Write("<script type=\"text/javascript\">window.open('./CSV/" + strFileCSVName + "','_blank');</script>;");查了一些網路討論, 發現問題出在</script>標籤.
Response.Write("<script type=\"text/javascript\">window.open('./CSV/" + strFileCSVName + "','_blank');<" + "/script" + ">");重點在於將拆開, 使其不在同一個字串中.
string Url = "http://l.yimg.com/tw.yimg.com/i/tw/hp/spirit/yahoo_logo.gif"; string FullFileName = @"c:\tmp\yahoo_logo.gif"; HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(Url); //預設TimeOut是30秒 webReq.Timeout = 30000; HttpWebResponse webResp = (HttpWebResponse)webReq.GetResponse(); //檢查儲存的檔案路徑,其目錄是否存在 if (!Directory.Exists(Path.GetDirectoryName(FullFileName))) { //建立目錄 Directory.CreateDirectory(Path.GetDirectoryName(FullFileName)); } using (BinaryReader imgStream = new BinaryReader(webResp.GetResponseStream())) { File.WriteAllBytes(FullFileName, imgStream.ReadBytes((int)webResp.ContentLength)); }