How to get List of Projects Linked to a Template

Posted: April 18, 2014 in Uncategorized


Imports SACLIENTLib
Imports System.Xml
Imports System.IO
Module Module1
Sub Main()
Dim objSAClient
Dim Project_Names As String
objSAClient = CreateObject("SAClient.SaApi.9")
objSAClient.login("http://Your_Server_Name:8080/qc​bin", "Your_User_ID", "Your_Password")
Console.WriteLine("Connected to the Site Administration..")
Project_Names = objSAClient.GetLinkedProjects("DEFAULT", "eApprove_V30119", "template")
'Console.WriteLine("Project Details are" + Project_Names)
Dim stream As StringReader
Dim reader As XmlTextReader = Nothing
Dim ProjectName As String = Nothing
Dim Temp = Nothing
stream = New StringReader(Project_Names)
reader = New XmlTextReader(stream)
While reader.Read()
If (reader.IsStartElement("PROJECT_NAME")) Then ProjectName = reader.ReadElementString
If ProjectName = Temp Then
Continue While
Else
Console.WriteLine(ProjectName)
End If
Temp = ProjectName
End While
reader.Close()
Console.ReadLine()
End Sub
End Module

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s