2008年4月28日

T800 基金管理軟體 Ver 0.6 Beta3

程式有改版了,請至以下網址查閱最新資訊:
http://t800fund.blogspot.com/2008/08/t800fund.html

2008年4月27日

Creating DataTable ...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Table1 As DataTable
Table1 = New DataTable("Customers")
'新增 DataTable 物件
Dim Row1, Row2, Row3 As DataRow
'新增三 個 rows 物件 for the table
Try
Dim Name As DataColumn = New DataColumn("Name")
'開始
Name.DataType = System.Type.GetType("System.String")

Table1.Columns.Add(Name)

Dim Product As DataColumn = New DataColumn("Product")
Product.DataType = System.Type.GetType("System.String")
Table1.Columns.Add(Product)
Dim Location As DataColumn = New DataColumn("Location")
Location.DataType = System.Type.GetType("System.String")
Table1.Columns.Add(Location)

Row1 = Table1.NewRow()
'declaring a new row
Row1.Item("Name") = "Reddy"
'filling the row with values. Item property is used to set the field value.
Row1.Item("Product") = "Notebook"
'filling the row with values. adding a product
Row1.Item("Location") = "Sydney"
'filling the row with values. adding a location
Table1.Rows.Add(Row1)
'adding the completed row to the table
Row2 = Table1.NewRow()
Row2.Item("Name") = "Bella"
Row2.Item("Product") = "Desktop"
Row2.Item("Location") = "Adelaide"
Table1.Rows.Add(Row2)
Row3 = Table1.NewRow()
Row3.Item("Name") = "Adam"
Row3.Item("Product") = "PDA"
Row3.Item("Location") = "Brisbane"
Table1.Rows.Add(Row3)
Catch
End Try

Dim ds As New DataSet
ds = New DataSet
'creating a dataset
ds.Tables.Add(Table1)
'adding the table to dataset
DataGrid1.SetDataBinding(ds, "Customers")
'binding the table to datagrid


End Sub

2008年4月19日

T800 基金管理軟體 Ver 0.5 Beta3

程式有改版了,請至以下網址查閱最新資訊:
http://blog.robbin0919.com/search/label/T800

2008年4月18日

HOW TO:辨識 Visual Basic HTML 字串中的文字

資料來源處:http://msdn2.microsoft.com/zh-tw/library/ms235379(VS.80).aspx
HOW TO:辨識 Visual Basic HTML 字串中的文字

這個範例會使用簡單的規則運算式 (Regular Expression) 移除 HTML 文件的標記。

範例
HTML 標記會與規則運算式 \<[^\>]+\> 相符,這表示:

字元 "<",之後接著 一或多個字元集合,不包括 ">" 字元,之後接著

字元 ">"。

這個範例會使用共用的 System.Text.RegularExpressions.Regex.Replace(System.String,System.String,System.String) 方法,以使用空字串取代標記規則運算式的所有符合項。

''' Removes the tags from an HTML document.
''' HTML text to parse.
''' The text of an HTML document without tags.
'''
Function GetTextFromHtml(ByVal htmlText As String) As String
Dim output As String = Regex.Replace(htmlText, "\<[^\>]+\>", "")
Return output
End Function

這個範例要求您必須使用 Imports 陳述式,匯入 System.Text.RegularExpressions 命名空間。如需詳細資訊,請參閱 Imports 陳述式

2008年4月9日

XML VB.NET Examples

資料來源處:http://www.example-code.com/vbdotnet/xml.asp
SSSSS

繪製統計圖表不求人

資料來源處:http://cpro.com.tw/channel/pcpro/content/index.php?news_id=8652

在 Windows Forms 列印報表

資料來源處:https://www.microsoft.com/taiwan/msdn/library/2003/May-2003-tw/printwinforms.htm

如何存取一個 Windows Form 在另一個 Windows Form 的成員藉由使用 Visual Basic . NET 或 Visual Basic 2005

資料來源處:http://support.microsoft.com/kb/841292/zh-tw

2008年4月7日

[ASP.Net]DataSet新增資料(DataRow)並透過xml格式儲存讀寫

[ASP.Net]DataSet新增資料(DataRow)並透過xml格式儲存讀寫




--------------------------------------------------------------------------------
try
{
//建立儲存選取之mailing List DataSet
DataSet ds = new DataSet();
ds.Tables.Add("CHECKED"); //新增CHECKED資料表至DATASET ds之中
ds.Tables["CHECKED"].Columns.Add("STU_ID"); //新增欄位STU_ID至DATASET ds之中
ds.Tables["CHECKED"].Columns.Add("STU_NAME");
ds.Tables["CHECKED"].Columns.Add("CMP_NAME");
ds.Tables["CHECKED"].Columns.Add("EMAIL");
for(int i = 0; i {
HtmlInputCheckBox app_no = (HtmlInputCheckBox)dgEmail.Items[i].FindControl("chkSTU_ID");

if(app_no.Checked)
{
System.Data.DataRow row = ds.Tables["CHECKED"].NewRow();

row["STU_ID"]=dgEmail.Items[i].Cells[6].Text; //由dgEmail這個DataGrid新增學生編號
row["STU_NAME"]=dgEmail.Items[i].Cells[0].Text;
row["CMP_NAME"]=dgEmail.Items[i].Cells[1].Text;
row["EMAIL"]=dgEmail.Items[i].Cells[4].Text;

ds.Tables["CHECKED"].Rows.Add(row);
}
}
//將建立之mailing List DataSet的資料寫入 mailList.xml 檔案
ds.WriteXml(Server.MapPath(Config.Document.Training_Education)+ "/mailList.xml",XmlWriteMode.WriteSchema);
ds.Dispose();
}
catch(Exception ex)
{
Response.Write(ex.Message);
}


--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(Config.Document.Training_Education)+"/mailList.xml");

2008年4月5日

HOW TO:建立縮圖影像

資料來源處: http://msdn2.microsoft.com/zh-tw/library/ets0sayh(vs.80).aspx

HOW TO:建立縮圖影像
縮圖影像是影像的縮小版本。您可以藉由呼叫 Image 物件的 GetThumbnailImage 方法來建立縮圖影像。

下列範例會從 Compass.bmp 檔案建構 Image 物件。原始影像的寬度為 640 個像素,高度為 479 個像素。程式碼會建立寬度為 100 個像素,高度為 100 個像素的縮圖影像。
下圖顯示的是縮圖影像。

Dim image As New Bitmap("Compass.bmp")
Dim pThumbnail As Image = image.GetThumbnailImage(100, 100, Nothing, _
New IntPtr())
e.Graphics.DrawImage( _
pThumbnail, _
10, _
10, _
pThumbnail.Width, _
pThumbnail.Height)