0

Hi,

I'm trying to create a webservice but I'm not very familiar with them and I'm having some issues getting code from a windows form into a webapplication that I now want to use. It's just a dictionary that I want to use with a webservice. This is the code

private Dictionary<string, string> _dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
        protected void Page_Load(object sender, EventArgs e)
        {
            using (var reader = new StreamReader(File.OpenRead(@"C:/dictionary.csv")))
            {
                while (!reader.EndOfStream)
                {
                    string[] tokens = reader.ReadLine().Split(';');
                    _dictionary[tokens[0]] = tokens[1];
                }
            }
        }

and I've tried every way I can think of to get it to work with a webservice but nothing is working. Can anyone point me in the right direction? This is the only part of my code that I can't get to work.

Jadex

2
Contributors
1
Reply
11
Views
3 Years
Discussion Span
Last Post by Ketsuekiame
0

What exactly is it that isn't working? How do you want it to work?

WebServices aren't WinForms applications so you should not treat them as such. I notice that the code you want is in the Page_Load. Are you wanting this code to run when the WebService starts up, at the beginning of each call or is it a call by itself?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.