EnableExplicit Global PBEx_IIS #PBEx_IIS_Protocol_HTTP = 0 #PBEx_IIS_Protocol_HTTPS = 1 #PBEx_IIS_Attribute_Site_ApplicationPool = 1 #PBEx_IIS_Attribute_Site_Path = 2 #PBEx_IIS_Attribute_Site_ConnectionTimeout = 3 #PBEx_IIS_Attribute_Site_MaxBandwidth = 4 #PBEx_IIS_Attribute_Site_MaxConnections = 5 #PBEx_IIS_Attribute_Site_MaxUrlSegments = 6 #PBEx_IIS_Attribute_ApplicationPool_AutoStart = 1 #PBEx_IIS_Attribute_ApplicationPool_Enable32BitAppOnWin64 = 2 #PBEx_IIS_Attribute_ApplicationPool_ManagedPipelineMode = 3 #PBEx_IIS_Attribute_ApplicationPool_ManagedRuntimeVersion = 4 #PBEx_IIS_Attribute_ApplicationPool_QueueLength = 5 #PBEx_IIS_Attribute_ApplicationPool_StartMode = 6 CompilerIf #PB_Compiler_Processor = #PB_Processor_x86 PBEx_IIS = OpenLibrary(#PB_Any, "PB.Ex_IIS_x86.dll") CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64 PBEx_IIS = OpenLibrary(#PB_Any, "PB.Ex_IIS_x64.dll") CompilerEndIf If PBEx_IIS Prototype CreateIISSite(SiteName.p-Unicode, Protocol, IPAddress.p-Unicode, Port, Domain.p-Unicode, Path.p-Unicode, ApplicationPool.p-Unicode, ErrorOutput) Global CreateIISSite.CreateIISSite = GetFunction(PBEx_IIS, "CreateIISSite") Prototype DeleteIISSite(SiteName.p-Unicode, ErrorOutput) Global DeleteIISSite.DeleteIISSite = GetFunction(PBEx_IIS, "DeleteIISSite") Prototype StartIISSite(SiteName.p-Unicode, ErrorOutput) Global StartIISSite.StartIISSite = GetFunction(PBEx_IIS, "StartIISSite") Prototype StopIISSite(SiteName.p-Unicode, ErrorOutput) Global StopIISSite.StopIISSite = GetFunction(PBEx_IIS, "StopIISSite") Prototype ExamineIISSite(ErrorOutput) Global ExamineIISSite.ExamineIISSite = GetFunction(PBEx_IIS, "ExamineIISSite") Prototype NextIISSiteEntry(ErrorOutput) Global NextIISSiteEntry.NextIISSiteEntry = GetFunction(PBEx_IIS, "NextIISSiteEntry") Prototype IISSiteEntryName(Output, ErrorOutput) Global IISSiteEntryName.IISSiteEntryName = GetFunction(PBEx_IIS, "IISSiteEntryName") Prototype FinishIISSite(ErrorOutput) Global FinishIISSite.FinishIISSite = GetFunction(PBEx_IIS, "FinishIISSite") Prototype CreateIISApplicationPool(ApplicationPoolName.p-Unicode, ErrorOutput) Global CreateIISApplicationPool.CreateIISApplicationPool = GetFunction(PBEx_IIS, "CreateIISApplicationPool") Prototype DeleteIISApplicationPool(ApplicationPoolName.p-Unicode, ErrorOutput) Global DeleteIISApplicationPool.DeleteIISApplicationPool = GetFunction(PBEx_IIS, "DeleteIISApplicationPool") Prototype StartIISApplicationPool(ApplicationPoolName.p-Unicode, ErrorOutput) Global StartIISApplicationPool.StartIISApplicationPool = GetFunction(PBEx_IIS, "StartIISApplicationPool") Prototype StopIISApplicationPool(ApplicationPoolName.p-Unicode, ErrorOutput) Global StopIISApplicationPool.StopIISApplicationPool = GetFunction(PBEx_IIS, "StopIISApplicationPool") Prototype ExamineIISApplicationPool(ErrorOutput) Global ExamineIISApplicationPool.ExamineIISApplicationPool = GetFunction(PBEx_IIS, "ExamineIISApplicationPool") Prototype NextIISApplicationPoolEntry(ErrorOutput) Global NextIISApplicationPoolEntry.NextIISApplicationPoolEntry = GetFunction(PBEx_IIS, "NextIISApplicationPoolEntry") Prototype IISApplicationPoolEntryName(Output, ErrorOutput) Global IISApplicationPoolEntryName.IISApplicationPoolEntryName = GetFunction(PBEx_IIS, "IISApplicationPoolEntryName") Prototype FinishIISApplicationPool(ErrorOutput) Global FinishIISApplicationPool.FinishIISApplicationPool = GetFunction(PBEx_IIS, "FinishIISApplicationPool") Prototype SetIISSiteAttribute(SiteName.p-Unicode, Attribute, Value.p-Unicode, ErrorOutput) Global SetIISSiteAttribute.SetIISSiteAttribute = GetFunction(PBEx_IIS, "SetIISSiteAttribute") Prototype GetIISSiteAttribute(SiteName.p-Unicode, Attribute, Output, ErrorOutput) Global GetIISSiteAttribute.GetIISSiteAttribute = GetFunction(PBEx_IIS, "GetIISSiteAttribute") Prototype SetIISApplicationPoolAttribute(ApplicationPoolName.p-Unicode, Attribute, Value.p-Unicode, ErrorOutput) Global SetIISApplicationPoolAttribute.SetIISApplicationPoolAttribute = GetFunction(PBEx_IIS, "SetIISApplicationPoolAttribute") Prototype GetIISApplicationPoolAttribute(ApplicationPoolName.p-Unicode, Attribute, Output, ErrorOutput) Global GetIISApplicationPoolAttribute.GetIISApplicationPoolAttribute = GetFunction(PBEx_IIS, "GetIISApplicationPoolAttribute") EndIf Global Output$ = Space(1024) Global ErrorOutput$ = Space(128) ;CreateIISApplicationPool("MyOwnAppPool", @ErrorOutput$) ;DeleteIISApplicationPool("MyOwnAppPool", @ErrorOutput$) ;CreateIISSite("MyOwnSite", #PBEx_IIS_Protocol_HTTPS, "", 81, "localhost", "D:\ht-docs\", "DefaultAppPool", @ErrorOutput$) ;DeleteIISSite("MyOwnSite", @ErrorOutput$) ;List all application pool Debug "Application pools:" If ExamineIISApplicationPool(@ErrorOutput$) While NextIISApplicationPoolEntry(@ErrorOutput$) IISApplicationPoolEntryName(@Output$, @ErrorOutput$) Debug Output$ Wend EndIf ;List all web sites Debug "Web sites:" If ExamineIISSite(@ErrorOutput$) While NextIISSiteEntry(@ErrorOutput$) IISSiteEntryName(@Output$, @ErrorOutput$) Debug Output$ Wend EndIf CloseLibrary(PBEx_IIS) ; IDE Options = PureBasic 5.60 (Windows - x64) ; CursorPosition = 72 ; FirstLine = 36 ; EnableXP ; EnableAdmin ; Executable = PB.Ex_MSSQL.exe ; CompileSourceDirectory ; EnableCompileCount = 948 ; EnableBuildCount = 7 ; EnableUnicode