共 70 篇文章 |
|
避免多次运行同一个程序进程。Process Instance = RunningInstance();if (Instance == null)Application.Show("条码打印程序已经在运行,请勿多开!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);ActiveForm(Instance);private static Process RunningInstance()Process current = Process.Process[] ProcessLi... 阅5 转0 评0 公众公开 23-05-21 08:13 |
C# 栈—— 入栈 出栈 获取栈顶元素 遍历 清空 数量_c#清空栈C# 栈—— 入栈 出栈 获取栈顶元素 遍历 清空 数量 Unity李大馋师 于 2021-04-28 15:07:50 发布 1793 收藏 3 分类专栏: # 集合 文章标签: C# Stack 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 阅4 转0 评0 公众公开 23-05-20 21:25 |
【有效解决】C# 报错System.StackOverflowException.递归到一定的量,占用足够的内存时照样会提示报错System.StackOverflowException。2.改变递归的写法 原先的递归写法:他对这两种的写法解释为:比较两种写法,第一种写法不断的递归,函数嵌套层数过多最后导致栈内存溢出,而第二种写法将循环的部分放到了另外一个函数,进入MethodB的时候Met... 阅82 转0 评0 公众公开 23-05-20 20:36 |
C# Replace() 方法用于获取一个新字符串,其中该字符串中出现的所有指定 Unicode 字符都替换为另一个指定的 Unicode 字符。public string Replace(Char first, Char second) public string Replace(String firstString, String secondString)范围。public class StringExample { public static void Main(string[] args) ... 阅8695 转1 评0 公众公开 22-05-15 10:27 |
//首先,使用命名空间using XY.WINUI.ControlEx.InvokeEx;//第一种//设置TextBox的值Invokes.SetTextBoxText(tbName,"TextBox文本");//获取TextBox的值string value = Invokes.GetTextBoxText(tbName);//第二种//设置TextBox的值TextBoxInvoke.SetTextBoxText(tbName,"TextBox文本");//获取TextBox的值string value = Text... 阅226 转0 评0 公众公开 22-05-08 01:04 |
//代理 public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Thread thread = new Thread(CrossThreadFlush); FlushClient=new FlushClient(ThreadFunction); FlushClient.BeginInvoke(null,null); } private void ThreadFunction() { while (true) { this.textBox1.Text = DateTime.Now.ToS... 阅148 转1 评0 公众公开 22-05-08 01:02 |
if (listBox1.Count >20) listBox1.Rows[i]["ID"] + ",执行完成!"); listBox1.SelectedIndex = listBox1.Items.Count - 1;delegate void AddItemCallback(string text);private void AddItem(string text) { if (this.listBox1.this.listBox1.Count >100) listBox1.public void Monitorlist(string text) { if(this... 阅45 转0 评0 公众公开 22-05-08 00:46 |
Combine(string path1, string path2 )的用法。public static string Combine ( string path1, string path2 )string path = Path.ArgumentNullException:“Value cannot be null.”string path = Path.Combine(null, "April.txt"); //System.ArgumentNullException:“Value cannot be null.”// "April.txt"string path =... 阅30 转0 评0 公众公开 22-05-07 15:38 |
使用 FlowLayoutPanel 排列控件演练:使用 FlowLayoutPanel 在 Windows 窗体上排列控件。两种控件均提供一种自动的可配置能力来控制包含在控件内的子控件的相对位置,并且两种控件均在运行时提供动态布局功能,以便它们可以在父窗体的尺寸更改时重新调整子控件的大小和对其进行重新定位。通过绘制控件轮廓插入控件。从 Button “工具箱” Butto... 阅466 转0 评0 公众公开 22-02-18 20:47 |
阅27 转1 评0 公众公开 21-08-07 08:14 |