[問題] 新手不會debug
小弟我剛學C#,有段程式看不出問題出在哪,是否有高手願意提點?
以下附上程式,也附上問題
1>C:\Users\99325113\Desktop\ConsoleApplication1\ConsoleApplication1\Program.cs(13,10,13,11):
error CS1513: 必須是 }
1>C:\Users\99325113\Desktop\ConsoleApplication1\ConsoleApplication1\Program.cs(40,1,40,2):
error CS1022: 必須是型別或命名空間定義,或檔案結尾
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
// /// <summary>
// 將 Image 轉換為 Byte 陣列。
// </summary>
// <param name="ImgPath">圖片路徑 。</param>
public static byte[] ImageToBuffer(string ImgPath)
{
byte[] _ImageBytes;
if (File.Exists(ImgPath))
{
Image _Image = Image.FromFile(ImgPath);
MemoryStream ms = new MemoryStream();
_Image.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
_ImageBytes = ms.GetBuffer();
ms.Dispose();
_Image.Dispose();
}
else
{
_ImageBytes = null;
}
return _ImageBytes;
}
}
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.64.84.134
推
02/18 13:45, , 1F
02/18 13:45, 1F
→
02/18 14:23, , 2F
02/18 14:23, 2F
推
02/18 17:58, , 3F
02/18 17:58, 3F
→
02/18 17:58, , 4F
02/18 17:58, 4F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章