小编Hic*_*ham的帖子

获取屏幕的实际尺寸

是否有可能获得以厘米为单位而不是以像素为单位的实际屏幕尺寸?即我需要知道屏幕的大小而不是它的分辨率。

如果在Windows应用程序中有可能,我需要这个。

c# windows

3
推荐指数
1
解决办法
638
查看次数

string不像引用类型

在下面的代码中,cpy值的更改不会影响ori值,因此string的行为不像引用类型:

string ori = "text 1";
string cpy = ori;
cpy = "text 2";
Console.WriteLine("{0}", ori);
Run Code Online (Sandbox Code Playgroud)

但是,一个类有不同的行为:

class WebPage
{
    public string Text;
}

// Now look at reference type behaviour
WebPage originalWebPage = new WebPage();
originalWebPage.Text = "Original web text";

// Copy just the URL
WebPage copyOfWebPage = originalWebPage;

// Change the page via the new copy of the URL
copyOfWebPage.Text = "Changed web text";

// Write out the contents of the page
// Output=Changed …
Run Code Online (Sandbox Code Playgroud)

c#

-4
推荐指数
1
解决办法
134
查看次数

标签 统计

c# ×2

windows ×1