TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rohit pol
NA
6
35k
initializing and accessing dictionary globally
Apr 21 2012 11:12 PM
Hi All,
I am loading Dictionary object with some values and wanted to access it throughout my project, how can I do that. Please see explained below.
public class class1{
class2 cl2 = new
class2();
cl2.
loadDataFile();
}
public class class3{
string str = "______________________";
class2 cls2 = new
class2();
cls2.
getStrings(str);
}
public class
class2{
protected Dictionary<string, string>
store
=
new Dictionary<string, string>();
public void
loadDataFile()
{
//logic to load data from file on certain
//conditions and store it in '
store
' Dictionary
object declared above.
}
public string
getStrings(sring str)
{
//Here I will access elements of '
store
'.
//I get '0' element. How to get elements here.
}
}
Thanks,
Reply
Answers (
7
)
Problem accessing link by using HttpWebRequest or WebBrowser
Https SSL login and PDF download