public Environment()
 {
     InitializeComponent();
     DirectoryInfo di = new DirectoryInfo(System.Environment.CurrentDirectory);
     string path = di.Parent.Parent.FullName;
     ds = new EnvironmentBasic();
     webBrowser1.Navigate(new Uri(path + @"/html/Environment.htm", UriKind.RelativeOrAbsolute));//获取根目录的日历文件
     webBrowser1.ObjectForScripting = ds;//该对象可由显示在WebBrowser控件中的网页所包含的脚本代码访问
 }
示例#2
0
        public Environment()
        {
            InitializeComponent();
            DirectoryInfo di   = new DirectoryInfo(System.Environment.CurrentDirectory);
            string        path = di.Parent.Parent.FullName;

            ds = new EnvironmentBasic();
            webBrowser1.Navigate(new Uri(path + @"/html/Environment.htm", UriKind.RelativeOrAbsolute)); //获取根目录的日历文件
            webBrowser1.ObjectForScripting = ds;                                                        //该对象可由显示在WebBrowser控件中的网页所包含的脚本代码访问
        }
        public MainWindow()
        {
            this.InitializeComponent();
            LoadRss();
            // Insert code required on object creation below this point.
            DirectoryInfo di = new DirectoryInfo(System.Environment.CurrentDirectory);
            string pathTraffic = di.Parent.Parent.FullName;
            wbTraffic.Navigate(new Uri(pathTraffic + @"/html/Traffic.htm", UriKind.RelativeOrAbsolute));
            string pathEmergency = di.Parent.Parent.FullName;
            ds = new EmergencyBasic();
            wbEmergency.Navigate(new Uri(pathEmergency + @"/html/Emergency.htm", UriKind.RelativeOrAbsolute));//获取根目录的日历文件
            wbEmergency.ObjectForScripting = ds;//该对象可由显示在WebBrowser控件中的网页所包含的脚本代码访问

            string pathEnvironment = di.Parent.Parent.FullName;
            ds1 = new EnvironmentBasic();
            wbenvironment.Navigate(new Uri(pathEnvironment + @"/html/Environment.htm", UriKind.RelativeOrAbsolute));//获取根目录的日历文件
            wbenvironment.ObjectForScripting = ds1;//该对象可由显示在WebBrowser控件中的网页所包含的脚本代码访问
        }