Posts

Showing posts from August, 2024

資料結構 - 佇列 (Data Structure - Queue)

  public class CMyQueue<T> : IMyLinkedList<T>  {      private CMyLinkedNodeModel<T> _node;      private CMyLinkedNodeModel<T> _currentNode;      public void Add(T item)      {          if (_node == null)          {              this._node = new CMyLinkedNodeModel<T>();              this._node.Data = item;              this._node.NextNode = null;              this._currentNode = this._node;          }          else          {              CMyLinkedNodeModel<T> nodeModel = new CMyLinkedNodeModel<T>();              nodeModel.Data = item;    ...

資料結構 - 題目

 堆疊          文字反轉

資料結構 - 堆疊 (C#)

Image
        在這個文章中會實現堆疊中的三個方法分別為新增(Add)、刪除(Delete)、查看當前節點(Get),建立Models(名稱:CMyLinkedNodeModel)來記錄數據的結構及定義堆疊動作(名稱:CMyStatck) 功能流程圖      新增功能               稍後補充      刪除                  稍後補充      查看當前節點                稍後補充 代碼部分 Models public class CMyLinkedNodeModel<T>     {         public T Data { get; set; }         public CMyLinkedNodeModel<T> NextNode {  get; set; }     }  public class CMyStatck<T> : IMyLinkedList<T> {     private CMyLinkedNodeModel<T> _node;     private CMyLinkedNodeModel<T> _currentNode;     public void Add(T item)     {         if (_node == null)         {          ...

Html Canvas

Image
Canvas          可以透過Java Script 繪圖 移動畫筆           moveTo(xPoint, yPoint); 畫直線           lineTo(xPoint, yPoint); 畫矩形           fillRect(0, 0, this.GetWidth(),this. GetHeight())  SetGrid(xGap, yGap) ; Js Code  class CanvasObject {     constructor(name) {         this.Element = document.getElementById(name)         this.ctx = this.Element.getContext("2d")     }     SetBackgroundColor(color) {         this.ctx.fillStyle = color         this.ctx.fillRect(0, 0, this.GetWidth(),this. GetHeight())     }     SetGrid(xGap, yGap) {         for (var i = 0; i < this.GetWidth(); i += xGap) {             this.DrawLine(i, 0, i, this.GetHeight())         }      ...

C# 程式 - IF 判斷 (含真值表)

Image
if( 判斷式){      判斷成功的動作 }  真值表

C# Report

Image
如何製作報表 1.      使用 NuGet - Solution 下載 Microsoft.ReportingServices.ReportViewerControl.Winforms 2.      使用 Manage Extensions 中下載 Microsoft RDLC Report Designer 2022 步驟 1.      將 LocalReport 物件建立出來                         LocalReport localReport = new LocalReport(); 2.      設定 Report 樣板路徑 檔案的副檔名是使用 rdlc ,可以使用 Report Designer 進行編輯 localReport.ReportPath = 路徑 ; localReport.ReportPath = "C:\Test.rdlc";   3.      設定報表數據 data 的類型 IEnumerable localReport.DataSources.Add(new ReportDataSource( 資料集名稱 , data)); 4.      生成報表 提供 byte[] 類型 localReport.Render( 輸出檔案的副檔名 ); localReport.Render("pdf");                         寫成檔案 File.WriteAllBytes(" 檔案名 ",byte[...