PIXNET Logo登入

式門遁甲

跳到主文

程式的記憶------- 開門、休門、生門、傷門、杜門、景門、驚門、死門

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 11月 27 週二 201221:49
  • (jQuery)開JQuery UI Dialog Modal視窗時,出現捲軸

開JQuery UI Dialog Modal視窗時,出現捲軸水平的和垂直的捲軸的修正方法
找了很久就只有下面的方法最好用
如果用隱藏的方式像是overflow:hidden的話,如果把視窗調小查詢的話,會出現一堆奇奇怪怪的問題
最後用的是position:fixed那個比較好用,雖然不支援舊的IE像IE6啦
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(1,450)

  • 個人分類:JavaScript、jQuery
▲top
  • 8月 09 週四 201216:30
  • (JavaScript)防止使用者回到上一頁

研究ㄌ很多方法,發現還是只有這個最好用...
 
因為我程式都會用到asp.net的Response.Redirect,這個會讓很多東西失效,像是location.replace那些...
 
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(2) 人氣(12,163)

  • 個人分類:JavaScript、jQuery
▲top
  • 11月 25 週五 201120:04
  • (ASP.NET)下列連接已經關閉: 無法和遠端伺服器建立信任關係。

這是跟SSL有關的問題
先寫一個Class
 internal class AcceptAllCertificatePolicy : ICertificatePolicy
 {
     public AcceptAllCertificatePolicy()
    {
     }
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(572)

  • 個人分類:C#-ASP.NET
▲top
  • 8月 21 週日 201123:39
  • (其它)Visual Studio 外掛們

Visual Studio 2010
◎輔助外掛--好用耶~
http://viml.nchc.org.tw/blog/paper_info.php?CLASS_ID=1&SUB_ID=1&PAPER_ID=189
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef?SRC=Home
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(906)

  • 個人分類:其它
▲top
  • 6月 01 週三 201108:35
  • (ASP.NET) 產生日曆


之前有寫了一篇JavaScript的產生日曆
這篇是改成用ASP.NET寫的
private void CreateCalendar(int Year, int Month, DataTable DT)
{
DateTime whichDate = new DateTime(Year,Month,1);
string strCalendar = "";
// 每月日數陣列
int[] monthDays = new int[]{31,28,31,30,31,30,31,31,30,31,30,31};
// 閏年判斷
int myYear = whichDate.Year;
int myMonth = whichDate.Month;
if ( ( (myYear % 4 == 0) && (myYear % 100 != 0) )
|| (myYear % 400 == 0) )
monthDays[1] = 29;
string [] myArray =
new string [7] {"Sunday","Monday","Tuesday","Wednesday"
,"Thursday","Friday","Saturday"};
string [] myArray2 = new string [7] {"0","1","2","3","4","5","6"};
// 該月第一天的星期
int day =
Convert.ToInt32(myArray2[Array.IndexOf(myArray, whichDate.DayOfWeek.ToString())]);
// 計算秀出時需要的格數
int total = monthDays[myMonth-1] + day;
int totalCells = total + ( (total%7 != 0) ? 7 - total%7 : 0  ); 
// 標題列
strCalendar ="<TABLE id=\"myCalendarTable\" class=\"myGrid\" style=\"border-collapse:
collapse\" cellSpacing=\"0\" cellPadding=\"4\" align=\"center\" width=\"100%\" border=\"0\">";
strCalendar += "<TR>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期日</TD>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期一</TD>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期二</TD>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期三</TD>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期四</TD>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期五</TD>";
strCalendar += "<TD class=\"GridHeading\" width=\"14%\">星期六</TD>";
strCalendar += "</TR>";
for (int i=0;i<totalCells;i++)
{
if ( i%7 == 0 )
{
strCalendar+="</TR><TR height=\"70px\">";
}
if ( i >= day && i < total )
{
int myDay = ((i-day)+1);
string myDateStr = whichDate.ToString("yyyy/MM/")  + myDay.ToString("D2");
if ( !DT.Rows.Contains(new DateTime(myYear,myMonth,myDay)) )
{
strCalendar += "<TD class=\"myItem\" onclick=\"addClass(this);\" >"+
myMonth.ToString("D2") + "/" + myDay.ToString("D2");
}
else
{
string myContentStr = "0";
DataRow rowFound;
// 設定DataTable的PrimaryKey,這樣之後才可以對這個DataTable作尋找內容的動作
DataColumn[] ColumnPrimaryKey = new DataColumn[1];
ColumnPrimaryKey[0] = DT.Columns["myDate"];
DT.PrimaryKey = ColumnPrimaryKey;
// 因為已經設定myDate為主鍵,他是DateTime型別的,故這邊用DateTime搜尋
rowFound = DT.Rows.Find(new DateTime(myYear,myMonth,myDay));
if( rowFound != null )
{
myContentStr = rowFound["whichNumber"].ToString();
}
strCalendar += "<TD class=\"myItem\" onclick=\"addClass(this);\">"+
myMonth.ToString("D2") + "/" + myDay.ToString("D2");
}
}
else
{
strCalendar += "<TD class=\"myItem\">&nbsp;";
}
strCalendar += "</TD>";
}
calendarDiv.InnerHtml = strCalendar;
}
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(844)

  • 個人分類:C#-ASP.NET
▲top
  • 6月 01 週三 201108:34
  • (ASP.NET)讓Html產生的Word在修改後不出現多的檔案


如果以Html產生Word,然後在Word2007 或Word2010 修改後按儲存的話
會出現多餘的資料夾和檔案(但是Word2003不會)
所以我就把產生的Word檔變成MHT格式的就好了
但是Word 2000會完全不能用=.="
雖然我不知道104人力銀行是怎麼做的
但做起來跟104人力銀行產生Word履歷表的功能很像~.~"
// Word
Response.AddHeader("content-disposition", "attachment;filename=WORD檔名.doc");
Response.ContentType = "application/msword
Response.Write("MIME-Version: 1.0" + Environment.NewLine);
Response.Write("Content-Type: multipart/mixed; boundary=\"myRegion\"" + Environment.NewLine);
Response.Write("--myRegion" + Environment.NewLine);
Response.Write("Content-Type: text/html" + Environment.NewLine + Environment.NewLine);
Response.Write("<html><body>");
Response.Flush();
StringWriter mySWriter = new StringWriter();
HtmlTextWriter myHWriter = new HtmlTextWriter(mySWriter);
某個控制項.RenderControl(myHWriter);
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=big5>");
Response.Write(mySWriter.ToString().Trim());
Response.Write("</body></html>");
Response.Write(Environment.NewLine + Environment.NewLine + "--myRegion--");
Response.Flush();
Response.End();
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(838)

  • 個人分類:C#-ASP.NET
▲top
  • 5月 09 週一 201113:07
  • (其它)免費的.Net反組譯工具ilspy


最近.NET Reflector宣佈他們的免費產品將改為收費產品後
就不能用免費的摟
所以就找了另一個免費的開放原始碼的.NET反組譯工具
這個社群的成立也是因為.NET Reflector要變收費,才成立的
http://www.ilspy.net
要裝.NET FrameWork 4.0才能跑喔
網頁裡都有~~
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(1) 人氣(2,803)

  • 個人分類:其它
▲top
  • 4月 15 週五 201119:58
  • (JavaScript)對Table取得與設定顏色之每一格、每一列、每一欄


// 先準備一些CSS
.mySelected { BACKGROUND: #D4D4FF }
.myHeaderSelected { BACKGROUND: #2AAAFF } 
// 設定Class
function addClass(Obj)
{
if ( hasClass(Obj) )
{
inpuObj.setAttribute('className','');
}
else
{
inpuObj.setAttribute('className','mySelected');
}
}
// 判斷是否有Class
function hasClass(Obj)
{
if ( Obj.getAttribute('className') != '' )
{
return true;
}
else
{
return false;
}
}
// 取得某Class的全部值
function getElementsByClassName(whichClass)  
{
var node = document.getElementsByTagName("body")[0];
var returnStr = "";
var re = new RegExp('\\b' + whichClass + '\\b');
var els = node.getElementsByTagName("*");
for(var i=0; i<els.length; i++)
{
// 假設els[i]的childNode[1]是存放著某個值的input標籤
if(re.test(els[i].getAttribute('className')))
returnStr += els[i].childNodes[1].value + ",";
}
return returnStr;
}
// 把所選取的TD的那一整行都變顏色
// 使用方法像是在TD上寫onclick='setColumnColor(this);'
// cellIndex只有TD有,TR沒有
function setColumnColor(Obj)
{
if ( !hasClass(Obj) )
{
Obj.setAttribute('className','myHeaderSelected');
}
else
{
Obj.setAttribute('className','');
}
var td = Obj.parentElement.parentElement.getElementsByTagName("td");
for(var i=0; i<td.length; i++)
{
if(td[i].cellIndex==Obj.cellIndex)
{
if ( !hasClass(Obj) )
{
td[i].setAttribute('className','');
}
else
{
td[i].setAttribute('className','mySelected');
}
}
}
}
// 把所選取的TD的那一整列都變顏色
// rowIndex只有TR有,TD沒有
function setRowColor(Obj)
{
if ( !hasClass(Obj) )
{
Obj.setAttribute('className','myHeaderSelected');
}
else
{
Obj.setAttribute('className','');
}
var td = Obj.parentElement.parentElement.getElementsByTagName("td");
for(var i=0; i<td.length; i++)
{
if(td[i].parentElement.rowIndex==Obj.parentElement.rowIndex)
{
if ( !hasClass(Obj) )
{
td[i].setAttribute('className','');
}
else
{
td[i].setAttribute('className','mySelected');
}
}
}
}
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(2,394)

  • 個人分類:JavaScript、jQuery
▲top
  • 4月 14 週四 201119:57
  • (JavaScript)產生日曆


var date = new Date();
function createCalendar(whichDiv)
{
  var strCalendar = "";
  
  // 每月日數陣列
  var monthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
  
  // 閏年判斷
  mYear = date.getFullYear();
  if ( ( (mYear % 4 == 0) && (mYear % 100 != 0) ) || (mYear % 400 == 0) ) monthDays[1] = 29;
  
  // 設定日期為該月第一天
  date.setDate(1);
  
  // 該月第一天的星期
  var day = date.getDay();
  
  // 計算秀出時需要的格數
  var total = monthDays[date.getMonth()] + day;
  var totalCells = total + ( total%7 ? 7 - total%7 : 0  ); 
  strCalendar ='<TABLE cellSpacing="1" cellPadding="0" align="center" width="400" bgcolor="#888888">';
  strCalendar += '<TR>';
  strCalendar += '<TH></TH>';
  strCalendar += "<TH>日</TH>";
  strCalendar += '<TH>一</TH>';
  strCalendar += '<TH>二</TH>';
  strCalendar += '<TH>三</TH>';
  strCalendar += '<TH>四</TH>';
  strCalendar += '<TH>五</TH>';
  strCalendar += '<TH>六</TH>';
  strCalendar += '</TR>';
  for (i=0;i<totalCells;i++)
  {
if ( i%7 == 0 )
strCalendar+="<TR><TD>&nbsp;</TD>";
if ( i >= day && i < total )
{
if ( i >= day )
{
var whichDate = date.getFullYear() + "/" + (date.getMonth()+1) + "/" + ((i-day)+1);
strCalendar += "<TD>"+((i-day)+1);
strCalendar += "<input id='Identity' type='hidden' value='" + whichDate + "'>";
}
}
else
{
strCalendar += "<TD>&nbsp;";
}
strCalendar += "</TD>";
if ( i%7 == 6 )
strCalendar += "</TR>";
   }
   document.getElementById(whichDiv).innerHTML = strCalendar;
}
呼叫的話就用,像以下就會產生2011年1月的日曆
date.setFullYear('2011');
date.setMonth(0);
createCalendar('myDiv');
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(3,180)

  • 個人分類:JavaScript、jQuery
▲top
  • 3月 11 週五 201118:17
  • (ASP.NET)將數字半形或英文半形轉成全形


// 轉換半形成全形(可轉英文或數字)
public static string CharForHalfToFull(string sourceChar)
{
string myReturnValue = "";
char [] myValue = sourceChar.ToCharArray(); 
for ( int i = 0; i < myValue.Length; i++ ) 
{ 
myReturnValue += (Convert.ToChar(Convert.ToInt32(myValue[i]) + 65248)).ToString(); 
} 
return myReturnValue; 
}
像是welkingunther0122就會變成
welkingunther0122
(繼續閱讀...)
文章標籤

welkingunther 發表在 痞客邦 留言(0) 人氣(1,363)

  • 個人分類:C#-ASP.NET
▲top
12...21»

BloggerAds

角色資料

welkingunther
暱稱:
welkingunther
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • (17,146)(C#)Stored Procedure相關之建立與呼叫
  • (8,937)(C#)用迴圈印出字母A到Z
  • (6,332)(SQL Server)刪不掉資料表裡的資料的解決方法之三種比較DELETE,TRUNCATE,DROP
  • (56,892)(C#)用WebBrowser控制項寫網頁抓取程式之一些心得
  • (9,836)(C#)控制DataSet/DataTable上一筆,下一筆之BindingSource運用
  • (8,974)(C#)用WinAPI隱藏Window工作列,讓畫面為全螢幕,移滑鼠座標
  • (16,007)(C#)滑鼠右鍵選單相關
  • (8,055)(C#)使用SqlBulkCopy複製資料表到資料庫
  • (1,812)(C#)用WinAPI控制工作列(TaskBar),設定自動隱藏AutoHide及顯示於最上層AlwaysOnTop
  • (10,021)(C#)自己做一個訊息方塊(MessageBox)

文章分類

  • ACG (5)
  • DB-SQL Server (7)
  • Flash (11)
  • C#-Window Form (73)
  • C#-ASP.NET (58)
  • C#-DevExpress (7)
  • JavaScript、jQuery (29)
  • XHTML、CSS (2)
  • 其它 (9)
  • 未分類文章 (1)

最新文章

  • (jQuery)開JQuery UI Dialog Modal視窗時,出現捲軸
  • (JavaScript)防止使用者回到上一頁
  • (ASP.NET)下列連接已經關閉: 無法和遠端伺服器建立信任關係。
  • (其它)Visual Studio 外掛們
  • (ASP.NET) 產生日曆
  • (ASP.NET)讓Html產生的Word在修改後不出現多的檔案
  • (其它)免費的.Net反組譯工具ilspy
  • (JavaScript)對Table取得與設定顏色之每一格、每一列、每一欄
  • (JavaScript)產生日曆
  • (ASP.NET)將數字半形或英文半形轉成全形

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: