WebService 내에서 CSV 파일을 사용하여 사전을 채우는 데 도움이 필요하지만 결과를 반환 할 수 없습니다.webservice를 사용하여 사전을 반환하십시오.
Im은 사전을 두 개의 분리 된 열로 구분하여 작동하지만 외관상으로는 작동하지만 두 개가 아닌 값을 반환 할 수는 없습니다. 여기
는 코드입니다.{
StreamReader streamReader = new StreamReader("T:/4 Year WBL/Applications Development/Coursework 2/2b/Coursework2bwebservice/abrev.csv");
[WebMethod]
public string Dictionary()
{
string line;
Dictionary<string, string> dictionary = new Dictionary<string,string>();
while ((line = streamReader.ReadLine()) !=null)
{
string[] columns = line.Split(',');
dictionary.Add(columns[0], columns[1]);
return dictionary;
}
}
내가 암시 적으로 어떤 아이디어가 중대하고 시간 내 주셔서 감사합니다 것 형에게 System.Collections.Generic.Dictionary<string,string to string>"
을 변환 할 수 없습니다 오류 "를 얻고있다
대단히 감사합니다. 매우 도움이되며 해결됩니다. 웹 서비스가 사전 클래스를 받아들이지 않기 때문에 당신이 적절하게 말하지 않더라도. 직렬화 된 XML 사전을 살펴보고 거기에서 시작하겠습니다. 다시 감사합니다. – user3034104