开发者

Which accessType should I use when calling InternetOpen?

According to the MSDN, you can specify an access type parameter to InternetOpen. Two of the options for the dwAccessType parameter are:

INTERNET_OPEN_TYPE_DIRECT - Resolves all host names locally. INTERNET_OPEN_TYPE_PRECONFIG - Retrieves the proxy or direct configuration from the registry.

Which of these should I use? I don't know which would be "better".开发者_开发技巧 We don't want our application to do anything clever, all we want it to do is access the internet in a normal way.


INTERNET_OPEN_TYPE_PRECONFIG is what you normally want. INTERNET_OPEN_TYPE_DIRECT means it should bypass any proxy that is configured. It can be useful for things like some trouble shooting, but it's ignoring how the user has things configured, which is rarely a good idea.


I have always used INTERNET_OPEN_TYPE_PRECONFIG, and it has always worked perfectly. I believe this is also the "default" value (if one may say so), because INTERNET_OPEN_TYPE_PRECONFIG = 0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜