CommonUtils.Framework/MessageUtil.cs

(完整代码) 1KB

using Microsoft.VisualBasic;
using System.Windows;

namespace CommonUtils
{
    public static class MessageUtil
    {
        //Show/Tip使用的引用不一样,但是好像没啥区别
        public static void Show(object value, params object[] args)
        {
            var message = value.ToString();
            if (args.Length > 0)
                message = message.Format(args);
            MessageBox.Show(message, "窗口提示");
        }

        public static void Tip(object value, params object[] args)
        {
            var message = value.ToString();
            if (args.Length > 0)
                message = message.Format(args);
            System.Windows.Forms.MessageBox.Show(message, "窗体提示");
        }

        public static string ShowInput(string tip, string input)
        => Interaction.InputBox(tip, "系统提示", input);

        public static string ShowInput(string input)
        => Interaction.InputBox("请输入或复制:", "系统提示", input);

        public static string GetInput(string tip, string input = null)
        => ShowInput(tip, input);
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。