您好我正在开发一个项目,我必须在DataGridView中显示保存在.json文件中的数据。任何帮助或回答对我来说都意味着很多。谢谢!
这是我制作的代码:
private void showData_Click(object sender, EventArgs e)
{
string json = File.ReadAllText(@"C:\Users\Aljaz\Documents\json1.json");
var dateTimeFormat = new IsoDateTimeConverter { DateTimeFormat = "dd/MM/yyyy" };
Employee employee = JsonConvert.DeserializeObject<Employee>(json, dateTimeFormat);
myDGView.DataSource = employee;