1分钟实现Autodesk Vault登录对话框

 

Autodesk Vault 2014 API中新引入的Autodesk Vault Development Framework(简称VDF)为Vault开发工作提供了非常便利的工具,显著的简化了我们的开发工作。下面介绍一个利用VDF实现Vault登录。

在Autodesk Vault开发中,第一项工作就要登录到Vault,使用VDF,你不用自己创建用户界面,只要一句话就可以实现和Autodesk Vault风格一致的登录对话框。首先,我们先在Visual Studio中创建一个winForm的应用程序,添加如下引用,这些程序集可以在Autodesk Vault 2014 SDK中找到。如果你还没有安装Vault SDK,Vault SDK的安装程序在 Vault Server或者Vault Client安装目录下的SDK目录中,比如C:\Program Files\Autodesk\Vault Professional 2014\SDK。Vault SDK默认的安装路径是C:\Program Files (x86)\Autodesk\Autodesk Vault 2014 SDK\

 

建立Winform的应用程序,添加如下引用:

"Autodesk.DataManagement.Client.Framework.Vault.Forms.dll"

"Autodesk.DataManagement.Client.Framework.dll"

"Autodesk.DataManagement.Client.Framework.Forms.dll"

"Autodesk.DataManagement.Client.Framework.Vault.dll"

image

下面是代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VDF = Autodesk.DataManagement.Client.Framework;

namespace VaultLogin
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            VDF.Vault.Forms.Library.Login(new VDF.Vault.Forms.Settings.LoginSettings());
        }
    }
}

执行结果:

image

是不是足够简单?


Related Posts Plugin for WordPress, Blogger...