Example #1
0
        private Vault CreateVault(string user, string password, string vault, string networkAddress = null)
        {
            /* login to the server and get the vault */
              var serverApp = new MFilesAPI.MFilesServerApplication();

              serverApp.Connect(
            AuthType: string.IsNullOrEmpty(user) ? MFAuthType.MFAuthTypeLoggedOnWindowsUser : MFilesAPI.MFAuthType.MFAuthTypeSpecificMFilesUser,
            UserName: string.IsNullOrEmpty(user) ? Type.Missing : user,
            Password: string.IsNullOrEmpty(password) ? Type.Missing : password,
            NetworkAddress: networkAddress == string.Empty ? null : networkAddress
              );
              var vaultsOnServer = serverApp.GetVaults();

              Vault v = null;
              foreach (MFilesAPI.VaultOnServer vaultOnServer in vaultsOnServer)
              {
            if (vaultOnServer.Name == vault)
            {
              v = vaultOnServer.LogIn();
              break;
            }
              }

              return v;
        }
Example #2
0
        private Vault CreateVault(string user, string password, string vault, string networkAddress = null)
        {
            /* login to the server and get the vault */
            var serverApp = new MFilesAPI.MFilesServerApplication();

            serverApp.Connect(
                AuthType: string.IsNullOrEmpty(user) ? MFAuthType.MFAuthTypeLoggedOnWindowsUser : MFilesAPI.MFAuthType.MFAuthTypeSpecificMFilesUser,
                UserName: string.IsNullOrEmpty(user) ? Type.Missing : user,
                Password: string.IsNullOrEmpty(password) ? Type.Missing : password,
                NetworkAddress: networkAddress == string.Empty ? null : networkAddress
                );
            var vaultsOnServer = serverApp.GetVaults();

            Vault v = null;

            foreach (MFilesAPI.VaultOnServer vaultOnServer in vaultsOnServer)
            {
                if (vaultOnServer.Name == vault)
                {
                    v = vaultOnServer.LogIn();
                    break;
                }
            }

            return(v);
        }