Клубове Дир.бг
powered by diri.bg
търси в Клубове diri.bg Разширено търсене

Вход
Име
Парола

Клубове
Dir.bg
Взаимопомощ
Горещи теми
Компютри и Интернет
Контакти
Култура и изкуство
Мнения
Наука
Политика, Свят
Спорт
Техника
Градове
Религия и мистика
Фен клубове
Хоби, Развлечения
Общества
Я, архивите са живи
Клубове Дирене Регистрация Кой е тук Въпроси Списък Купувам / Продавам 09:37 24.06.24 
Клубове/ Компютри и Интернет / ASP Всички теми Следваща тема Пълен преглед*
Информация за клуба
Тема Re: Object required: 'WScript' & za teodor [re: Pechenia]
Авторpsy (Нерегистриран) 
Публикувано12.06.03 16:24  



win2k adv server
bez antivir software
a po interesnoto e che v tut ot M$ pak se polzva samo che WScript.Shell i primera si varvi
a WScript.Network ne go razpoznava
inache eto ia funckiata prerabotena ot men za teodor

Function CreateDir(strParam)

Dim strVirtualDirectoryName 'IIS Virtual Directory Name
Dim bolInProcessApplication 'IIS In Process Application Flag
Dim objIIS 'ADSI IIS Object
Dim strVirtualDirectoryPath 'IIS Virtual Directory Path
Dim objFileSystem 'VBScript FileSystemObject
Dim strOwner 'NT Folder Owner
Dim objVirtualDirectory 'ADSI IIS Virtual Directory Object
Dim bolScriptPermissions 'IIS script permissions flag
Dim strHTTPReferer 'IIS Referrer Page
Dim strServerName 'NT local machine name
Dim objWSH 'Windows Script Host Object
Dim objRTC 'Return
Dim strACLCommand 'Command Line string to set ACLs

'obarni vnimanie na tozi red tuk predavash parametara ot funkciata za ime na virt direktoria
strVirtualDirectoryName = strParam
strHTTPReferer = Request.ServerVariables("HTTP_REFERER")
strServerName = Request.ServerVariables("SERVER_NAME")


' Did we come from our form? If not then deny access
'If strHTTPReferer <> "http://" & strServerName & "/ServineSecure/default.asp" then
' Response.Write("Access Denied")
' Response.End
'End If


'strOwner = Request.Form("selectOwner")

'If Request.Form("checkboxScript") = "on" Then
' bolScriptPermissions = "True"
'Else
' bolScriptPermissions = "False"
'End If


' Does this IIS application already exist in the metabase?
On Error Resume Next
Set objIIS = GetObject("IIS://localhost/W3SVC/1/Root/" & strVirtualDirectoryName)

If Err.Number = 0 Then
Response.Write ("An application with this name already exists. Click ")
Response.Write ("<A HREF=http://" &strServerName & "/dir/>")
Response.Write ("here</A> to choose a different name.")
Response.End
End If

Set objIIS = Nothing

'Create the IIS application
Set objIIS = GetObject("IIS://localhost/W3SVC/1/Root")
strVirtualDirectoryPath = objIIS.Path & "\" & strVirtualDirectoryName

Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")

'Test to see if the folder exists in the filesystem.
' If not, create it
On Error Resume Next
Set Folder = objFileSystem.GetFolder(strVirtualDirectoryPath)
If Hex(Err.number) = "4C" Then
objFileSystem.CreateFolder strVirtualDirectoryPath
End If

Set objFileSystem = Nothing


'Create the folder in the filesystem
Set objVirtualDirectory = objIIS.Create("IISWebVirtualDir",strVirtualDirectoryName)
objVirtualDirectory.AccessScript = bolScriptPermissions
objVirtualDirectory.Path = strVirtualDirectoryPath
objVirtualDirectory.SetInfo
objVirtualDirectory.AppCreate bolInProcessApplication

'Set Change Permissions for the developer using CACLS.exe
strACLCommand = "cmd /c echo y| CACLS "
strACLCommand = strACLCommand & strVirtualDirectoryPath
strACLCommand = strACLCommand & " /g " &strOwner & ":C"

Set objWSH = Server.CreateObject("WScript.Shell")
objRTC = objWSH.Run (strACLCommand , 0, True)

Set objWSH = Nothing

Response.Write("<B>Web Application Created Sucessfully</B><BR>")
Response.Write("Path : "& strVirtualDirectoryPath & "<BR>")
'Response.Write("Script Permissions : "& bolScriptPermissions &"<BR>")
'Response.Write( strOwner & " has been granted change permissions<BR>")
End Function




Цялата тема
ТемаАвторПубликувано
* about FlieSystemObject teodor   11.06.03 14:43
. * Re: about FlieSystemObject psy   11.06.03 14:49
. * Това jamie   11.06.03 21:30
. * Re: about FlieSystemObject Pechenia   12.06.03 08:25
. * Re: about FlieSystemObject teodor   12.06.03 11:00
. * Re: about FlieSystemObject asp1O1   12.06.03 11:02
. * Re: about FlieSystemObject Pechenia   12.06.03 13:12
. * Re: Object required: 'WScript' psy   12.06.03 14:08
. * Re: Object required: 'WScript' Pechenia   12.06.03 14:53
. * Re: Object required: 'WScript' & za teodor psy   12.06.03 16:24
. * Тегли jamie   12.06.03 22:36
. * re psy   13.06.03 11:52
Клуб :  


Clubs.dir.bg е форум за дискусии. Dir.bg не носи отговорност за съдържанието и достоверността на публикуваните в дискусиите материали.

Никаква част от съдържанието на тази страница не може да бъде репродуцирана, записвана или предавана под каквато и да е форма или по какъвто и да е повод без писменото съгласие на Dir.bg
За Забележки, коментари и предложения ползвайте формата за Обратна връзка | Мобилна версия | Потребителско споразумение
© 2006-2024 Dir.bg Всички права запазени.