Delete file programatically

If you are having a problem using Vault, post a message here.
Post Reply
kv09blu
Posts: 3
Joined: Fri Aug 02, 2013 3:01 am

Delete file programatically

Post by kv09blu » Fri Aug 02, 2013 3:41 am

Hi,
Do you have any code examples in C# or Visual Basic (Visual Studio 2010) where a file stored in Vault can be deleted programatically?
We are using Vault Professional 6.1.0

Thanks

KV

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Delete file programatically

Post by Beth » Fri Aug 02, 2013 8:00 am

Most of our C# examples are in this post here: http://support.sourcegear.com/viewtopic.php?f=31&t=8020.

In the Vault API download should be a .chm that has all the documentation. Look for ServerOperations.ProcessCommandDelete Method
Beth Kieler
SourceGear Technical Support

kv09blu
Posts: 3
Joined: Fri Aug 02, 2013 3:01 am

Re: Delete file programatically

Post by kv09blu » Mon Aug 05, 2013 7:06 am

Hi Beth,

Thanks for the reply. Have got a VB version working well-

Dim fileVaultFilePathAndFileName(0) As String

' strVaultFilePathAndFileName is e.g. $/Test/Directory1/TestFil01.png

fileVaultFilePathAndFileName(0) = strVaultFilePathAndFileName

Try
ServerOperations.ProcessCommandDelete(fileVaultFilePathAndFileName)
lblTest8.Text = "*** DELETE FROM VAULT *** : " & strVaultFilePathAndFileName & " : DELETED O.K."
Catch ex As Exception
lblTest8.Text = "*** FAILED Delete from Vault *** " & strVaultFilePathAndFileName & " : " & ex.Message.ToString
End Try


Regards,

KV

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Delete file programatically

Post by Beth » Mon Aug 05, 2013 8:20 am

Thanks for the update
Beth Kieler
SourceGear Technical Support

Post Reply