473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Obsolete functions

Hi

I am getting obsolete function warnings on these two liens but can't figure
the correct syntax for the new equivalent functions;

ConfigurationSettings.AppSettings.Get(key)
Dns.GetHostByName(_strServer)

Would appreciate if someone can give me some hints to get rid of the
obsolete function warnings on these two lines.

Thanks

Regards
Feb 1 '08 #1
5 1519
The <appSettingssection of your web.config file is now superseded by the
<applicationSettingssection, so you are being warned to not use the older
appSettings property.

Sorry, I don't know about the other one.
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:u9**************@TK2MSFTNGP02.phx.gbl...
Hi

I am getting obsolete function warnings on these two liens but can't
figure the correct syntax for the new equivalent functions;

ConfigurationSettings.AppSettings.Get(key)
Dns.GetHostByName(_strServer)

Would appreciate if someone can give me some hints to get rid of the
obsolete function warnings on these two lines.

Thanks

Regards

Feb 2 '08 #2
I know the first is:

ConfigurationManager.AppSetting(key)

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:u9**************@TK2MSFTNGP02.phx.gbl...
Hi

I am getting obsolete function warnings on these two liens but can't
figure the correct syntax for the new equivalent functions;

ConfigurationSettings.AppSettings.Get(key)
Dns.GetHostByName(_strServer)

Would appreciate if someone can give me some hints to get rid of the
obsolete function warnings on these two lines.

Thanks

Regards


Feb 3 '08 #3
Yes, but appSettings is now considered obsolete, in favor or
applicationSettings.
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:e7**************@TK2MSFTNGP03.phx.gbl...
>I know the first is:

ConfigurationManager.AppSetting(key)

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
"John" <Jo**@nospam.infovis.co.ukwrote in message
news:u9**************@TK2MSFTNGP02.phx.gbl...
>Hi

I am getting obsolete function warnings on these two liens but can't
figure the correct syntax for the new equivalent functions;

ConfigurationSettings.AppSettings.Get(key)
Dns.GetHostByName(_strServer)

Would appreciate if someone can give me some hints to get rid of the
obsolete function warnings on these two lines.

Thanks

Regards


Feb 3 '08 #4
Be very careful if you would try to replace GetHostByName with GetHostEntry.
About an year ago I also tried to replace GetHostByName deprecated warning
with GetHostEntry.
The problem is that GetHostEntry doesn't work correctly on some of the OSes.
I think at least XP was affected. There was quit long discussion on MSDN
forums regarding this problem. May be since then this problem has been fixed
with a hotfix or SP, but anyway do pay attention to this issue.

Regards,
Yury

"John" <Jo**@nospam.infovis.co.ukwrote in message
news:u9**************@TK2MSFTNGP02.phx.gbl...
Hi

I am getting obsolete function warnings on these two liens but can't
figure the correct syntax for the new equivalent functions;

ConfigurationSettings.AppSettings.Get(key)
Dns.GetHostByName(_strServer)

Would appreciate if someone can give me some hints to get rid of the
obsolete function warnings on these two lines.

Thanks

Regards

Feb 3 '08 #5
Hi there,

For the first query, you need the ConfigurationManager object (found in System.Configuration.dll).
This object replaces the ConfigurationSettings object and contains methods
such as AppSettings() to allow you to retrieve values from config files.

As for the DNS stuff, I'll leave that to someone else as I'm not sure about
that one.

Jas.
Hi

I am getting obsolete function warnings on these two liens but can't
figure the correct syntax for the new equivalent functions;

ConfigurationSettings.AppSettings.Get(key)
Dns.GetHostByName(_strServer)
Would appreciate if someone can give me some hints to get rid of the
obsolete function warnings on these two lines.

Thanks

Regards

Feb 4 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jbeerni | last post by:
In .NET, you can mark methods and accessors as obsolete by using the directive. I've found some interesting behavior with the directive when used in a class which is referenced as a return type...
4
by: BrianProgrammer | last post by:
I have this code below, that works like a champ, but two lines are continually marked as obsolete. See embeded notes. Private Shared Function TransformHTMLString(ByVal XSLT As String, _ ByVal...
2
by: Steve James | last post by:
I am trying to mark an override method in a derived class as obsolete using the ObsoleteAttribute. The compiler, however is not picking up this attribute and is not generating a warning or an...
1
by: BrianProgrammer | last post by:
I have this code below, that works like a champ, but two lines are continually marked as obsolete. See embeded notes. Private Shared Function TransformHTMLString(ByVal XSLT As String, _ ByVal...
1
by: Mike Hofer | last post by:
I've got two statements in my code that are both generating weird, weird, weird messages: The first one was, Dim document As System.Xml.XmlDocument Dim navigator As...
4
by: Phill W. | last post by:
If I have a reusbale (GAC-'registered') assembly that contains two, related classes (imagine a DataSet and DataTable; the former contains instances of the latter, the latter has a reference to its...
9
by: Erwin Moller | last post by:
Hi, Can anybody comment on this? In comp.lang.php I advised somebody to skip using: <script language="javascript"> and use: <script type="text/javascript"> And mr. Dunlop gave this response:
16
by: cj | last post by:
I am under the impression they are obsolete methods included for backward compatibility. For instance is using filedatetime("c:\myfile.txt") still the accepted way of getting the date...
11
by: raylopez99 | last post by:
I just downloaded the apparently free SDK for DirectX 9, all 200+ MB of it, but as I read about WPF I wonder: is DirectX obsolete? Should I even bother learning how to use it? After all, the end...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.