简体   繁体   中英

Can't use some functions in C#!

I can't seem to get access to some C# functions even though I have included the proper files/references! I can't seem to get access to System.Net.Dns or System.Net.WebRequest.GetRequestStream! Any ideas what could be causing this?

I'm guessing that you're using Silverlight, where those aren't available.

If you go to the MSDN page for WebRequest.GetRequestStream or System.Net.Dns , you'll see a link near the top that says "Other Versions". If you click on it, you'll see that it lists a number of things like ".NET Framework 4". If the platform you're using isn't listed, you can't use the API. For example, Silverlight isn't mentioned for those APIs, so they're not available in Silverlight.

对于第一个博客,此博客条目可能也很感兴趣/使用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM