SetRootPath Method

Set root directory of mailbox.

[Syntax]
C++: HRESULT SetRootPath( BSTR sPath, long* pVal ) 
Visual Basic: SetRootPath( sPath As String ) As long
C#: long SetRootPath( string sPath )  

Parameters

sPath

Full path of root directory

Return Value

If this method succeeds, the return value is zero. If it fails, the return value is non-zero.

Remarks

Default root directory of mailbox is anpop.dll current directory\MailFolders. eg: C:\Program Files\AdminSystem.NET\ANPOP\MailFolders. All mailboxes created by CreateMailBox method are default to be saved in this folder. SetRootPath method can be used to set root of mailbox to another directory.

Usage Example

[Visual Basic]
Sub SetRootPath
  Dim oStore As ANPOPLib.MSGSTORE
  Dim rootFolder As String

  rootFolder = "c:\mailboxs\user1"
  If oStore.SetRootPath( rootFolder ) = 0 Then
    MsgBox "set root succeeded"
  Else
    MsgBox "set root failed"
  End If
End Sub
[C#]
public void SetRootPath()
{
  MSGSTOREClass oStore = new MSGSTOREClass();
  string rootFolder = "c:\\mailboxs\\user1";

  try
  { 
    if( oStore.SetRootPath( rootFolder ) != 0 )
      throw new Exception( "set root failed" );
      
    Console.WriteLine( "set root succeeded" );
  }
  catch( Exception e)
  {
    Console.WriteLine( e.Message );
  }
  
  oStore = null;
}

2001-2007 © Copyright AdminSystem Software Limited. All rights reserved.