日期:2014-05-17  浏览次数:20733 次

C#的Service项目中,怎么使用FolderBrowserDialog?
本帖最后由 andytang555 于 2011-04-19 19:25:58 编辑
最近做了一个可交互的服务类,FolderBrowserDialog能显示,但只有描述,确定,取消等按钮,没有文件夹内容啊?RootFolder换了几个几没反应,求指点!非常感谢!


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;
using System.IO;
using System.Windows.Forms;
using System.Threading;
using Name.APIClasses.Core;

namespace AndyRuntimeService
{
    public partial class Service1 : ServiceBase
    {
        private Thread m_thread;
        /**
         * 
         */
        public Service1()
        {
            InitializeComponent();
            m_thread = new Thread(new ThreadStart(S_FormShow));
            m_thread.Priority = ThreadPriority.Normal;
        }
        //=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--
        // static 
        //=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--
        public static void S_FormShow()
        {
            FormAPI2.GetDesktopWindow();
            /*
            */
            IntPtr hSavedWinStation = FormAPI2.GetProcessWindowStation();
            IntPtr dwThreadId = FormAPI2.GetCurrentThreadId();
            IntPtr hSavedDeskThread = FormAPI2.GetThreadDesktop(dwThreadId);
            /*
            */