一月 9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication1.Models;
using WebApplication1.Services;

namespace WebApplication1.Controllers
{
    public class MessageController : Controller
    {
        messageDBService data = new messageDBService(); //實作Services的物件 (其含有兩個方法:1.取得資料庫資料並回傳 2.接收資料並寫進資料庫)
        // GET: Message
        public ActionResult Index()             //執行Index檢視頁面 (首頁或索引頁面)
        {
            return View(data.GetData());        //將資料傳回View (使用方法1.)
        }

        public ActionResult Create()            //執行Create檢視頁面 (新增資料的頁面)
        {
            return View();
        }

        [HttpPost]                              //當瀏覽器發送HTTP POST請求才會執行
        public ActionResult Create(string Article_title, string Content)        //當使用Create這個Action且有帶參數時
        {
            data.DBCreate(Article_title, Content);      //把資料寫進資料庫 (使用方法2.)

            return RedirectToAction("Index");           //回到Index這個Action
        }
    }
}
一月 8
JAVA
Interface跟抽象class只要有定義方法,在class中就必須要再對此方法做完整的定義。

C#
將共同特性從類別中萃取的過程,稱之為抽象化。
abstract class:封裝同類型物件的共同特性,如機車、公車的車輛屬性。
interface:定義不同類型物件的共同特性,滑鼠、NB的USB介面。
	介面可視為一份合約,合約的內容可透過實作此介面的類別加以實現。
	利用介面將實作內容與定義分離,可為日後程式的開發及擴充性保留彈性。
	為介面命名時,習慣在最前面加上I,意指Interface。

abstract:一定要override,否則也要宣告為abstract
virtual:可改可不改
sealed:不可改
一月 7
Interface: 定義為抽象的概念,與Class差別為,界面雖然有包含屬性與方法,但只宣告而不包含實作內容。
--類別只能"繼承"一個父類別,但能"實作"(語法跟繼承很像)多個介面。(老爸只能有一個,乾爹可以認很多個的概念)
--類別實作介面時,只會得到方法的名稱,不會包含任何實作內容。
一月 4
class Aaa{}				//class類別
  decimal Bbb(){}		//method方法
    int Ccc{get; set;} 	//property屬性

。不含set的屬性被視為唯讀
。不含get的屬性被視為唯寫
。同時具有這兩種存取子的屬性則為可讀寫
一月 2
Console.WriteLine()	秀畫面並換行;
Console.Write()		秀畫面;

========================

Console.Write(string.Format("{0}*{1}={2:00}\t", j, i, j * i));
//類矩陣的方式,定義每個值的顯示方式


继续浏览 »

十二月 27

十二月 22

昨天同事反映给客户寄信时,部分邮件会变成乱码。拿到问题邮件后,是一个纯文本的乱码信,而寄件方的寄件备份里却是 HTML 格式,这与以往遇到的情况不太一样,以往是寄出时,使用了 RTF 格式,且对方不是使用 Outlook,才会导致内容损坏。

继续浏览 »

十二月 21

  昨日在安裝新電腦啟用Office 2013序號時,跳出一个‘很抱歉’提示,An error occurred,Unable to process your request at the moment。Please try again later。(0xC004C780)」,Then it jumps to the screen to choose online or phone activation。

继续浏览 »

十二月 20

  My impression dates back to high school,Whenever a cold starts with a sore throat,It always ends with a three-month-long cough,So I have always been afraid of colds that start with a cough,And my body constitution often makes seeing a doctor ineffective,Therefore, there were several years when I wouldn't see a doctor for a cold,後來又試了幾年會很乖的去看醫生,但效果還是有限。
继续浏览 »

十二月 20

之前外部同事反馈,手机上的 Line 可以正常发送信息,但无法发送图片,而使用另一条网络就正常。研究了一阵子,想到可能是 MTU 的问题,恰好出问题的 Sonet 网络是通过 pppoe 拨号,于是上网查找建议数值,一般建議是1492或1484而Sonicwall防火牆預設值是1500在調整過後,Line即可正常发送图片。
继续浏览 »