小编alt*_*ify的帖子

Uri.EscapeUriString - 如何使用它?

我是 C# 新手,所以感谢您的帮助。我有以下调用 API 的代码。我需要对 URL 值进行编码。现在我不知道该怎么做。我将不胜感激您的帮助。

谢谢你。

    private void DeviceDetect_Load(object sender, EventArgs e)
    {

        var printerQuery = new ManagementObjectSearcher("Select * from Win32_Printer");
        foreach (var printer in printerQuery.Get())
        {
            var name = printer.GetPropertyValue("Name");
            var status = printer.GetPropertyValue("Status");
            var isDefault = printer.GetPropertyValue("Default");
            var isNetworkPrinter = printer.GetPropertyValue("Network");
            var description = printer.GetPropertyValue("Description");
            var PortName = printer.GetPropertyValue("PortName");
            var Location = printer.GetPropertyValue("Location");
            var Comment = printer.GetPropertyValue("Comment");


                string macAddress = string.Empty;
                System.Diagnostics.Process pProcess = new System.Diagnostics.Process();
                pProcess.StartInfo.FileName = "arp";
                pProcess.StartInfo.Arguments = "-a " + PortName;
                pProcess.StartInfo.UseShellExecute …
Run Code Online (Sandbox Code Playgroud)

c# api url uri html-escape-characters

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

标签 统计

api ×1

c# ×1

html-escape-characters ×1

uri ×1

url ×1