Exemplo n.º 1
0
        private UltimateFileServer ultimateFileServer;                                            // 引擎对象

        private void UltimateFileServerInitialization()
        {
            ultimateFileServer                    = new UltimateFileServer();                         // 实例化对象
            ultimateFileServer.KeyToken           = new Guid("A8826745-84E1-4ED4-AE2E-D3D70A9725B5"); // 指定一个令牌
            ultimateFileServer.LogNet             = new HslCommunication.LogNet.LogNetSingle(Application.StartupPath + @"\Logs\123.txt");
            ultimateFileServer.FilesDirectoryPath = Application.StartupPath + @"\UltimateFile";       // 所有文件存储的基础路径
            ultimateFileServer.ServerStart(34567);                                                    // 启动一个端口的引擎

            // 订阅一个目录的信息,使用文件集容器实现
            GroupFileContainer container = ultimateFileServer.GetGroupFromFilePath(Application.StartupPath + @"\UltimateFile\Files\Personal\Admin");

            container.FileCountChanged += Container_FileCountChanged;                         // 当文件数量发生变化时触发
        }
        private void UltimateFileServerStart( )
        {
            if (!int.TryParse(textBox10.Text, out int port))
            {
                MessageBox.Show("Advanced文件服务器引擎的端口号输入异常");
            }

            ultimateFileServer = new UltimateFileServer( );
            ultimateFileServer.FilesDirectoryPath = textBox8.Text;                                                                  // 设置文件的存储路径
            ultimateFileServer.Token  = new Guid(textBox9.Text);                                                                    // 令牌
            ultimateFileServer.LogNet = new Communication.LogNet.LogNetSingle(Application.StartupPath + "\\Logs\\UltimateLog.txt"); // 日志
            ultimateFileServer.LogNet.BeforeSaveToFile += LogNet2_BeforeSaveToFile;
            ultimateFileServer.ServerStart(port);
        }
Exemplo n.º 3
0
        private UltimateFileServer ultimateFileServer;                                            // 引擎对象

        private void UltimateFileServerInitialization()
        {
            ultimateFileServer = new UltimateFileServer();                                        // 实例化对象
            ultimateFileServer.FilesDirectoryPath = Application.StartupPath + @"\UltimateFile";   // 所有文件存储的基础路径
            ultimateFileServer.ServerStart(34567);                                                // 启动一个端口的引擎
        }