C# equivalent to php associative array

前端 未结 3 1967
故里飘歌
故里飘歌 2020-12-06 18:35

I\'m customizing a shopping cart application in php. In this application, I have to integrate some parts with another C#.net application, so I\'m using a webservice in a php

相关标签:
3条回答
  • 2020-12-06 19:16

    Try to use a Hashtable

    http://msdn.microsoft.com/en-au/library/system.collections.hashtable%28v=vs.80%29.aspx

    0 讨论(0)
  • 2020-12-06 19:22

    I think you want a Dictionary<string, int>. But I could be wrong. You should see what the generated class is used when you call the web service.

    To call the web service, right click the References folder of your project. Say Add Service Reference.

    Put the WSDL url in there and let it generate the classes for you.

    0 讨论(0)
  • 2020-12-06 19:34

    My guess is that the reason the Dictionary isn't working with the web service call is that Dictionary isn't serializable. Try a SerializableDictionary instead; there's an implementation here:

    http://www.dacris.com/blog/2010/07/31/c-serializable-dictionary-a-working-example/

    0 讨论(0)
提交回复
热议问题