如何使用xamarin跨平台开发从本地获得JSON数据。
尝试以下:
Type classType = typeof(Yourclassnamehere);
TypeInfo classTypeInfo = classType.GetTypeInfo();
Assembly assemblyType = classTypeInfo.Assembly;
System.IO.Stream stream = assemblyType.GetManifestResourceStream(classType.Namespace + ".sampledata.json");
System.IO.StreamReader sr = new System.IO.StreamReader(stream);
string json = sr.ReadToEnd();