天天看點

typelib

I searched for time to get an idea of what to do. Therefore as help, I am posting my findings here....

You web page must run with the rights to alter or read information from the ISA server.

You can do development on your machine but you need to install ISA server remote admin. Put the ISA CD in and go for an install. Choose custom install when asked and only install remote admin tools.

When you start to develop in Visual Studio, add a reference to "msfpccom.dll" this is in "C:/Program Files/Microsoft ISA Server/" on my machine so use your brain to find yours. This will give you an FPCLIB object that you use to do stuff with ISA server.

Below is an example of how to find a destination set and list its contents. This will therefore show you how to create an instance of the object to handle this stuff and so on....

Dim action As String = Request.QueryString( "action" )

Select Case action

Case "games"

Dim root As FPCLib.FPC = New FPCLib.FPC()

Dim fpcDS As FPCLib.FPCDestinationSet =  _

root.Arrays.Item "server" ).PolicyElements.DestinationSets.Item( "Recreational Sites" )

Dim dsC As FPCLib.FPCDestination

Dim dt As DataTable = New DataTable( "stuff" )

Dim dr As DataRow

Dim dc As New DataColumn( "item" )

dt.Columns.Add(dc)

For Each dsC In fpcDS

dr = dt.NewRow()

dr.Item( "item" ) = dsC.DomainName

dt.Rows.Add(dr)

Next

GridView1.DataSource = dt

GridView1.DataBind()

Case "Unsuitable"

' This is the universally bannnnnned list

Dim root As FPCLib.FPC = New FPCLib.FPC()

Dim fpcDS As FPCLib.FPCDestinationSet = root.Arrays.Item( "server" ).PolicyElements.DestinationSets.Item( "Recreational Sites" )

Dim dsC As FPCLib.FPCDestination

Dim dt As DataTable = New DataTable( "stuff" )

Dim dr As DataRow

Dim dc As New DataColumn( "item" )

dt.Columns.Add(dc)

For Each dsC In fpcDS

dr = dt.NewRow()

dr.Item( "item" ) = dsC.DomainName

dt.Rows.Add(dr)

Next

GridView1.DataSource = dt

GridView1.DataBind()

End Select

More help can be got from the microsoft website. Here is a link in to one of the properies. The rest can be found from there.

http://msdn2.microsoft.com/en-us/library/ms818627.aspx

This is the first thing like this I have done in VB.NET so please do not comment on my crappy coding. I hope this helps someone. Thanks

D A N ! ! ! 

Case ""

' Page error

繼續閱讀