小编Ops*_*Ops的帖子

添加抗锯齿

我正在尝试使用抗锯齿,但我不知道为什么它不起作用:

    {
        Pen pen = new Pen(Color.Black, 3);
        Pen r = new Pen(Color.YellowGreen, 3);
        Graphics b = panel2.CreateGraphics();
        b.DrawEllipse(pen, 6, 0, 90, 90);
        b.SmoothingMode = SmoothingMode.AntiAlias;
        b.DrawLine(r, new Point(50, 90), new Point(50, 0));
    }
Run Code Online (Sandbox Code Playgroud)

c# winforms

2
推荐指数
1
解决办法
2560
查看次数

中位数c#错误计算

当我把1,2,3我的中位数= 44时我的中位数计算有问题我不知道为什么

double wynik = 0;
string x1 = textBox1.Text;
string[] tab = x1.Split(',');
int n = tab.Length;

Array.Sort(tab);

if (n % 2 == 0)
{
    double c = x1[(n / 2) -1];
    double v = x1[(n / 2)];
    wynik = (c + v) / 2;
}
else
    wynik = x1[n / 2];

        textBox2.Text = wynik.ToString();
Run Code Online (Sandbox Code Playgroud)

c# median winforms

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

c#如何检查文件是否存在

我想检查文件是否存在于我的程序所在的同一文件夹中。如果是做某事。我该如何解决?

private void button12_Click(object sender, EventArgs e)
{

    if (File.Exists(Path.GetDirectoryName(Application.ExecutablePath) + "tres.xml"))
         Upload("tres.xml");

}
Run Code Online (Sandbox Code Playgroud)

c# file winforms

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

标签 统计

c# ×3

winforms ×3

file ×1

median ×1