第一种: 现在我把资源文件的路径放在application.properties里 config.path=/home/myservice/config.properties @PropertySource(value = {"file:${config.path}"}, encoding="utf-8") public class MyConfig { @Value("${myconfig.index}") private String ind
一.Model层 using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Mvc_Demo.Models { public class Person { public int Age { get; set; } public string Name { get; set; } public string Sex { get; set; } } } 二.控制器层 u