相关疑难解决方法(0)

Windows RegKey - 默认浏览器应用程序路径

RegKey可以从哪个版本获取默认浏览器应用程序的路径?

从C#/ .NET获取它的最佳方法是什么?

.net c# windows registry

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

使用隐藏的WindowStyle启动Process.Start url

我有一个在服务器上验证我的凭据的URL.有没有办法让它看不见?简单的代码看起来完全像这样:

public void DoAuth()
    {
        String uri = GetUri();
        ProcessStartInfo startInfo = new ProcessStartInfo(uri);
        startInfo.WindowStyle = ProcessWindowStyle.Hidden;
        Process.Start(startInfo);

    }
Run Code Online (Sandbox Code Playgroud)

ProcessWindowStyle.Hidden似乎没有做到这一点.如果我设置UseShellExecute为false然后我收到Win32Exception消息The system cannot find the file specified 该url是Spotify服务器上的身份验证以获取播放列表,它看起来像这样https://accounts.spotify.com/authorize/client_id=26d287105as12315e12ds56e31491889f3cd293..

还有其他方法可以使这个过程不可见吗?

编辑:http示例

public void DoAuth()
    {
        String uri = GetUri();

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
        HttpWebResponse webResponse;
        try
        {
            webResponse = (HttpWebResponse)request.GetResponse();
            Console.WriteLine("Error code: {0}", webResponse.StatusCode);
            using (Stream data = webResponse.GetResponseStream())
            using (var reader = new StreamReader(data))
            {
                //do what here?
            }
        }
        catch (Exception e) …
Run Code Online (Sandbox Code Playgroud)

c# url styles webclient process

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

标签 统计

c# ×2

.net ×1

process ×1

registry ×1

styles ×1

url ×1

webclient ×1

windows ×1