(MA30+MA72)/2 偏離幅度:30日均價加72日均價除以二,本欄數字表示價格偏離此均價的百分比幅度,此數值為自調參數, 例如超過10%表示價格可能回落,低於-10%表示價格可能反彈。
PPO(Price Oscillator):類似 MACD 指標。
CCI:數值低代表超賣,可能將有反彈。
McClellan Oscillator:數值低代表超賣,可能將有反彈。
Breadth Thrust:低於30%代表超賣,可能將有反彈。
2014年5月16日 星期五
2014年4月22日 星期二
msSQLserver isNumeric 判斷是否為數字
isNumeric 判斷是否為數字
若要在資要庫中判斷字串是否為數字,可使用isNumeric(值)函數
根據回傳值 0-非數值、1-數值,進行篩選!
根據回傳值 0-非數值、1-數值,進行篩選!
1
2
| select * from STKwhere isNumeric(LocNo)=1 |
2014年4月16日 星期三
2014年4月10日 星期四
asp.net 呼叫執行檔使用vb.net
Dim ps As New System.Diagnostics.ProcessStartInfo() ps.FileName = "C:\windows\system32\ping.exe" ps.Arguments = "www.pchome.com.tw -t" '視窗狀態 ps.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal System.Diagnostics.Process.Start(ps)
2014年4月7日 星期一
VB.net DataGridView 資料列 排序
參考http://wachaolala.blogspot.tw/2011/07/vb-datagridview.html
'gridview 篩選過後資料是否開放各欄位排序,
(暫定物料編號排序,鎖死)
'以最適欄寬顯示所有資料,並鎖死欄寬
'gridview 滑鼠划過資料列,顏色醒目提示
'第一頁,上一頁,目前頁數/總頁數,下一頁,最後一頁,目前資料第幾筆,資料總筆數
可能SQL也要改寫(count 資料筆數)
怎麼讓他分頁去顯示DataGridView
怎麼讓她列印或是轉Excel,能夠所有分頁資料都轉
'使用者拖拉自訂 Column 順序
可能SQL也要改寫(count 資料筆數)
怎麼讓他分頁去顯示DataGridView
怎麼讓她列印或是轉Excel,能夠所有分頁資料都轉
改變每一列的顏色
If DataGridView1.Rows.Count <> 0 Then
For i As Integer = 0 To DataGridView1.Rows.Count - 1
If (i Mod 2) = 0 Then
DataGridView1.Rows(i).DefaultCellStyle.BackColor = System.Drawing.Color.LightGreen
Else
DataGridView1.Rows(i).DefaultCellStyle.BackColor = System.Drawing.Color.LimeGreen
End If
Next
End If
For i As Integer = 0 To DataGridView1.Rows.Count - 1
If (i Mod 2) = 0 Then
DataGridView1.Rows(i).DefaultCellStyle.BackColor = System.Drawing.Color.LightGreen
Else
DataGridView1.Rows(i).DefaultCellStyle.BackColor = System.Drawing.Color.LimeGreen
End If
Next
End If
============================================
DataGridView.Sort 方法 (DataGridViewColumn, ListSortDirection)
===============================================================
滑鼠划過資料列,顏色醒目提示
目前會碰到說,每次滑鼠移動,整個 GridView 畫面會閃爍
'滑鼠於 DataGridView 上任一列移動時,改變該列顏色
Private Sub DataGridView1_CellMouseEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellMouseEnter
If e.RowIndex > 0 Then
DataGridView1.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.FromArgb(224, 224, 224)
SetStyle(ControlStyles.DoubleBuffer, True)
End If
End Sub
'滑鼠於 DtaGridView 離開任一列時,改回原本顏色
Private Sub DataGridView1_CellMouseLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellMouseLeave
If e.RowIndex > 0 Then
DataGridView1.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.White
End If
End Sub
'當 DatagridView 資料繫結以後,限制為無法再排序
Private Sub DataGridView1_DataBindingComplete(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete
'以物料編號 遞增排序
DataGridView1.Sort(DataGridView1.Columns("物料編號"), System.ComponentModel.ListSortDirection.Ascending)
'限制無法再以其他方式排序
DataGridView1.Columns(1).SortMode = DataGridViewColumnSortMode.NotSortable
End Sub
==============================================================
DataGridView 分頁功能
http://dotnetmis91.blogspot.com/2008/09/datagridview.html
要注意的是,他首頁的 pageFlag = 0
所以要顯示的時候,需要注意 加1,減1 的問題
'滑鼠於 DataGridView 上任一列移動時,改變該列顏色
Private Sub DataGridView1_CellMouseEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellMouseEnter
If e.RowIndex > 0 Then
DataGridView1.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.FromArgb(224, 224, 224)
SetStyle(ControlStyles.DoubleBuffer, True)
End If
End Sub
'滑鼠於 DtaGridView 離開任一列時,改回原本顏色
Private Sub DataGridView1_CellMouseLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellMouseLeave
If e.RowIndex > 0 Then
DataGridView1.Rows(e.RowIndex).DefaultCellStyle.BackColor = Color.White
End If
End Sub
'當 DatagridView 資料繫結以後,限制為無法再排序
Private Sub DataGridView1_DataBindingComplete(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles DataGridView1.DataBindingComplete
'以物料編號 遞增排序
DataGridView1.Sort(DataGridView1.Columns("物料編號"), System.ComponentModel.ListSortDirection.Ascending)
'限制無法再以其他方式排序
DataGridView1.Columns(1).SortMode = DataGridViewColumnSortMode.NotSortable
End Sub
==============================================================
DataGridView 分頁功能
http://dotnetmis91.blogspot.com/2008/09/datagridview.html
要注意的是,他首頁的 pageFlag = 0
所以要顯示的時候,需要注意 加1,減1 的問題
2014年4月6日 星期日
甘特圖功能
http://code.daypilot.org/68118/gantt-chart-tutorial-asp-net-sql-server-c-vb-net
http://social.msdn.microsoft.com/Forums/zh-TW/041dd496-5519-4d33-8d57-a63c751df185?forum=236
http://dlhsoft.com/GanttChartLibrary/Home.aspx
參考 Code Project 中的範例
http://www.codeproject.com/KB/miscctrl/Gantt_Chart.aspx
http://www.codeproject.com/KB/cpp/ganttlib.aspx
https://www.youtube.com/watch?v=ZjHAlSGF1S4&feature=youtu.be
jQuery Gantt Chart
http://blog.hellocode.info/2012/11/jquery-gantt-chart-jquery.html
http://www.blueshop.com.tw/board/show.asp?subcde=BRD201305102148459OE&fumcde=FUM20041006161839LRJ
MS CHART
http://blog.miniasp.com/post/2008/10/Useful-aspnet-and-winform-charting-control-from-Microsoft.aspx
SAMPLE DOWNLOAD
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418
http://social.msdn.microsoft.com/Forums/zh-TW/041dd496-5519-4d33-8d57-a63c751df185?forum=236
http://dlhsoft.com/GanttChartLibrary/Home.aspx
參考 Code Project 中的範例
http://www.codeproject.com/KB/miscctrl/Gantt_Chart.aspx
http://www.codeproject.com/KB/cpp/ganttlib.aspx
https://www.youtube.com/watch?v=ZjHAlSGF1S4&feature=youtu.be
jQuery Gantt Chart
http://blog.hellocode.info/2012/11/jquery-gantt-chart-jquery.html
http://www.blueshop.com.tw/board/show.asp?subcde=BRD201305102148459OE&fumcde=FUM20041006161839LRJ
MS CHART
http://blog.miniasp.com/post/2008/10/Useful-aspnet-and-winform-charting-control-from-Microsoft.aspx
SAMPLE DOWNLOAD
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=4418
2014年4月2日 星期三
列印功能
列印DIV 引用資訊園
方法
寫 script language="javascript" type="text/javascript"> function doPrint() { bdhtml=window.document.body.innerHTML; sprnstr=""; eprnstr=""; prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); window.document.body.innerHTML=prnhtml; window.print(); }
終止 /script>
看HTML
function printBlock(htmlBlock) {
var content = htmlBlock.innerHTML;
var printPage = window.open("", "printPage", "");
printPage.document.open();
printPage.document.write("");
printPage.document.write("
");
printPage.document.write(content);
printPage.document.close("");
}
web列印大全
引用
1、控制"縱打"、 橫打”和“頁面的邊距。
(1)
(2)
onclick="javascript:printit()">
onclick="javascript:printsetup();">
onclick="javascript:printpreview();">
onclick="javascript:window.close();">
------------------------------------------------
關於這個元件還有其他的用法,列舉如下:
WebBrowser.ExecWB(1,1) 打開
Web.ExecWB(2,1) 關閉現在所有的IE視窗,並打開一個新視窗
Web.ExecWB(4,1) 保存網頁
Web.ExecWB(6,1) 列印
Web.ExecWB(7,1) 列印預覽
Web.ExecWB(8,1) 列印頁面設置屬性
Web.ExecWB(10,1) 查看頁面屬性
Web.ExecWB(15,1) 好像是撤銷,有待確認
Web.ExecWB(17,1) 全選
Web.ExecWB(22,1) 刷新
Web.ExecWB(45,1) 關閉表單無提示
2、分頁列印
<%while not rs.eof%>
<%=rs(0)%>
<%rs.movenext%>
<%wend%>
3、ASP頁面列印時如何去掉頁面底部的路徑和頂端的頁碼編號
(1)ie的檔-〉頁面設置-〉講裏面的頁眉和頁腳裏面的東西都去掉,列印就不出來了。
(2)
New Document
4、浮動幀列印
4、用FileSystem元件實現WEB應用中的本地特定列印
伺服器端腳本:
<%………
set conn=server.CreateObject ("adodb.connection")
conn.Open "DSN=name;UID=XXXX;PWD=XXXX;"
set rs=server.CreateObject("adodb.recordset")
rs.Open(“select ……”),conn,1,1
……….%> //與資料庫進行交互
HTML頁面編碼:
………
//調用列印函數
> //保存伺服器端傳來的資料
………
方法
寫 script language="javascript" type="text/javascript"> function doPrint() { bdhtml=window.document.body.innerHTML; sprnstr=""; eprnstr=""; prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); window.document.body.innerHTML=prnhtml; window.print(); }
終止 /script>
看HTML
說明:這是開始列印的位置
列印內容列印內容列印內容列印內容列印內容列印內容列印內容列印內容
adfhioasdhfiohasdofihosdhfosdhfiosdhfiosdfhsdfhsdifsidfiosdfhosdhf
說明:這是結束列印的位置
function printBlock(htmlBlock) {
var content = htmlBlock.innerHTML;
var printPage = window.open("", "printPage", "");
printPage.document.open();
printPage.document.write("");
printPage.document.write("
");
printPage.document.write(content);
printPage.document.close("");
}
web列印大全
引用
1、控制"縱打"、 橫打”和“頁面的邊距。
(1)
(2)
onclick="javascript:printit()">
onclick="javascript:printsetup();">
onclick="javascript:printpreview();">
onclick="javascript:window.close();">
------------------------------------------------
關於這個元件還有其他的用法,列舉如下:
WebBrowser.ExecWB(1,1) 打開
Web.ExecWB(2,1) 關閉現在所有的IE視窗,並打開一個新視窗
Web.ExecWB(4,1) 保存網頁
Web.ExecWB(6,1) 列印
Web.ExecWB(7,1) 列印預覽
Web.ExecWB(8,1) 列印頁面設置屬性
Web.ExecWB(10,1) 查看頁面屬性
Web.ExecWB(15,1) 好像是撤銷,有待確認
Web.ExecWB(17,1) 全選
Web.ExecWB(22,1) 刷新
Web.ExecWB(45,1) 關閉表單無提示
2、分頁列印
<%while not rs.eof%>
<%=rs(0)%>
<%rs.movenext%>
<%wend%>
3、ASP頁面列印時如何去掉頁面底部的路徑和頂端的頁碼編號
(1)ie的檔-〉頁面設置-〉講裏面的頁眉和頁腳裏面的東西都去掉,列印就不出來了。
(2)
4、浮動幀列印
4、用FileSystem元件實現WEB應用中的本地特定列印
伺服器端腳本:
<%………
set conn=server.CreateObject ("adodb.connection")
conn.Open "DSN=name;UID=XXXX;PWD=XXXX;"
set rs=server.CreateObject("adodb.recordset")
rs.Open(“select ……”),conn,1,1
……….%> //與資料庫進行交互
HTML頁面編碼:
………
//調用列印函數
> //保存伺服器端傳來的資料
………
訂閱:
文章 (Atom)