java的calss中,在public static void main(String[] args) { }方法中调用非static的方法:在main方法中创建该calss的对象,用对象调用非static方法 public class Test{ public void testaction(){ //方法体 } public static void main(String[] args) { Test test = new Test(); test.testaction(); } }…
You should use: Data Source=|DataDirectory|\MyDb.sdf |DataDirectory| points to the App_Data folder. 在程序启动时,设置AppDomain.CurrentDomain.setData(“DataDirectory”,我的目录字符串);Winform的程序那当然是在Main函数中了,废话不说了,我的代码如下 ) { if (p.EndsWith(…