window.open
window.open開啟新視窗的方法:
如下圖所示,如果希望用window.open開啟視窗僅有一個,而不是重複開啟多個不同的新視窗,
即可在window.open的第二個參數中設定名稱

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

記錄發送Mail的功能:
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress("寄件者");
Msg.To.Add("收件者");
Msg.To.Add("收件者");
Msg.CC.Add("副本收件者");
Msg.Bcc.Add("密件副本");
Msg.Subject = "Test Mail";//標題
Msg.Body = "content test!!";//內文
Msg.SubjectEncoding = Encoding.UTF8;
Msg.BodyEncoding = Encoding.UTF8;//編碼
Msg.IsBodyHtml = true;//是否以html顯示
string filePath = @"D:\test.pdf"; //要附加的檔案
Attachment attachment1 = new Attachment(filePath);
attachment1.Name = System.IO.Path.GetFileName(filePath);
attachment1.NameEncoding = Encoding.GetEncoding("utf-8");
attachment1.TransferEncoding = System.Net.Mime.TransferEncoding.Base64;//編碼
attachment1.ContentDisposition.Inline = true;
attachment1.ContentDisposition.DispositionType = System.Net.Mime.DispositionTypeNames.Inline;
Msg.Attachments.Add(attachment1);
SmtpClient smtp = new SmtpClient("SMTP位置");
smtp.EnableSsl = true;//是否開啟SSL連線
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new NetworkCredential("帳號","密碼");
SmtpClient smtp = new SmtpClient(WebConfigurationManager.ConnectionStrings["webconfig紀錄之連線資訊"].ConnectionString);
try
{
smtp.Send(Msg);
attachment1.Dispose();
Msg.Dispose();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

Calendar
紀錄一下功能實作
 
建立一個新的aspx頁面
拉入一個Calendar控制項與一個Button按鈕,

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

html中要使用表單form分別要傳遞到不同的執行網頁可以用Javascript來處理兩個以上的submit.
sample:
 
<script Language="javascript">

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

id 用元素的name來填入
function checkID( id ) 
{
tab = "ABCDEFGHJKLMNPQRSTUVXYWZIO"
A1 = new Array (1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3 );
A2 = new Array (0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5 );
Mx = new Array (9,8,7,6,5,4,3,2,1,1);

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

CSS 
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css">
#top-bar{
width:100%;
height:100px;
background:#00ff00;
position:fixed;
top:-65px;
/* CSS3 陰影*/
-webkit-box-shadow: 0px 8px 15px #333;
-moz-box-shadow: 0px 8px 15px #333;
box-shadow: 0px 8px 15px #333;
}
</style>

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

<?php
// Use fopen function to open a file
$file = fopen("test.txt", "r");

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

create trigger test_to_log_2(trigger的名稱) after(before|after) update(insert|update)
on test_main(資料表名稱)
begin
insert into test_log(record_id,record_name) values (old.id,old.name);
insert into test_log(record_id,record_name) values (new.id,new.name);
end;

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS Bin</title>
</head>
<body>
單價:<input type="text" ng-model="price" ng-init="price = 10"/>

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

假設hello.cs檔案放在d:
指令:
csc /out:d:\hello.exe d:\hello.cs
out:第一個路徑是指檔案編譯要輸出到哪,第二個路徑是指原本檔案放在哪。

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

WebClient obj = new WebClient();
WebProxy proxy = new WebProxy("proxy.hinet.net", 80);
obj.Proxy = proxy;

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

string conn = " Provider = Microsoft.ACE.OLEDB.12.0 ; Data Source = " + location + ";Extended Properties='Excel 12.0;HDR=NO'";//連結字串中的HDR=YES,代表略過第一欄資料

OleDbConnection oledb_conn = new OleDbConnection(conn);//連線位址

oledb_conn.Open();//開啟連線

OleDbCommand oledb_com = new OleDbCommand("select * from [工作表1$]", oledb_conn);//搜尋資料

OleDbDataReader oledb_dr = oledb_com.ExecuteReader();//讀取
int i = 0;
while (oledb_dr.Read())//連線狀態
{

if (i > 1)
{
break;
}
Console.WriteLine(oledb_dr[0].ToString());
i++;
}

芭樂養樂多 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。