使用C#更改Firefox默认下载位置 [英] Change firefox default download location using C#

查看:76
本文介绍了使用C#更改Firefox默认下载位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用Firefox从服务器下载文件.但是我不知道如何通过我的C#代码更改默认的下载位置.不可能吗?
有人可以帮帮我吗??紧急

谢谢

In my application I used firefox to download a file from a server. But I dont know how to change the default download location through my C# code. Is it impossible??
Can someone please help me?? urgent

Thanks

推荐答案

我认为使用Firefox没有意义.这就像用左脚抓挠右耳一样.

要下载文件,只需使用System.Net.HttpWebRequest.请参阅:
http://msdn.microsoft.com/en-us/library/system.net. httpwebrequest.aspx [ ^ ].

如果您可能需要使用某些凭据进行身份验证,请参见以下下载代码示例:
http://stackoverflow.com/questions/4699938/如何使用httpwebrequest-and-httpwebresponse-classcookies下载文件 [ http://msdn.microsoft.com/en-us/library/system.net. webclient.aspx [^ ].

WebClient方法已简化,但HttpWebRequest没有可能的高级功能.

—SA
I see no sense in using Firefox. This is the same as scratching your right ear with you left foot.

To download a file, you just need to use System.Net.HttpWebRequest. Please see:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].

In case you may need to authenticate with some credentials, here is the download code sample:
http://stackoverflow.com/questions/4699938/how-to-download-the-file-using-httpwebrequest-and-httpwebresponse-classcookies[^].

Another option is using the class System.Net.WebClient and one of its download methods. Please see:
http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx[^].

The WebClient methods are simplified, but without advanced functionality possible with HttpWebRequest.

—SA


这篇关于使用C#更改Firefox默认下载位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆