2020年10月18日 星期日

如果呼叫Dispose之後仍然佔用記憶体 (c#)

如果呼叫Dispose之後仍然佔用記憶体,

等了很久還是佔用,

有可能是因為有Form是private的,

將所有Form改為public,

再呼叫Dispose,等待一段時間試試(還回記憶体的時間會加快)。

2020年10月16日 星期五

System.Web.UI.DataVisualization.Charting missing error in .net 4.0?(轉貼)

The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)


 Click on Add References in your project and Browse to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 and add the System.Web.DataVisualization dll file.

Before adding the dll remove the previous one and make sure that change the Target Frameweok to V4.0 in the project properties.

This will solve your problem.

2020年10月15日 星期四

VS 2017 C# change the name of output dll

 

change the name of output dll


Depending on which version of Visual Studio.NET you are running, try going to Project Properties -> Application, and then change the Assembly Name field. On earlier versions it might be in a different place but I think the Assembly Name field is still the one you are looking for.



2020年10月13日 星期二

在Html中的table選擇某一column (轉貼)

 

Select only certain text in an HTML table

Updated: 04/01/2018 by Computer Hope
select text in html table

In Mozilla Firefox, users may highlight only certain rows, columns, or cells of an HTML table by holding down the Ctrl key on the keyboard and click each cell individually. Once you have selected the appropriate cells, you can copy and paste their text into another program, such as a text editor or word processor. Additionally, clicking and dragging the mouse up or down a column, or left or right through a row achieves a similar effect.

Note

Unfortunately, this tip only works in Firefox. Other browsers, such as Chrome and Internet Explorer, do not support this feature.

2020年10月12日 星期一

Regular Expression 與 C# Regex

11 . 匹配除「\n」之外的任何單個字元。要匹配包括「\n」在內的任何字元,請使用像「[.\n]」的範式。
17 [xyz] 字符集合。匹配所包含的任意一個字元。
18 [^xyz] 負值字符集合。匹配未包含的任意字元。

注意:\d是只有匹配1個數字,並非多個。

參:https://jimmy0222.pixnet.net/blog/post/36958669

Do I need to explicitly close the StreamReader in C# when using it to load a file into a string variable?(轉貼)

 Example:

variable = new StreamReader( file ).ReadToEnd();

Is that acceptable?

47

No, this will not close the StreamReader. You need to close it. Using does this for you (and disposes it so it's GC'd sooner):

using (StreamReader r = new StreamReader("file.txt"))
{
  allFileText = r.ReadToEnd();
}

Or alternatively in .Net 2 you can use the new File. static members, then you don't need to close anything:

variable = File.ReadAllText("file.txt");

2020年10月6日 星期二

自動修正換行字元For windows and Linux to the same with windows

 C:\Users\<使用者帳戶>\.gitconfig

  [core]

        autocrlf = false