, 09 2006 . 20:24
+
, Internet Explorer.
, , .
, .
, com-. com- IE , - " Active X ", .
- , Microsoft MSScripting, vb-script.
- :
Sub MakeObject(ClassName)
set MakeObject=CreateObject(ClassName)
End Sub
, , MakeObject MSScripting CreateObject.
<a href="https://www.liveinternet.ru/users/fixin/post9416687/">В VB Script нету Collection</a><br/>Совсем оборзели гейтсописцы!
В VB Script (для Outlook и ваще) нету Collection.
Приходится пользоваться массивами, блин.
С помощью массива я сэмулировал коллекцию, кому надо, наслаждайтесь:
Public Function MyCollection_Create()
Dim a(200)
a(0) = 0
MyCollection_Create = a
End Function
Public Sub MyCollection_Add(Collection, Value, Key)
For i = 1 To Collection(0)
If Collection(i * 2 - 1) = Key Then
Collection(i * 2) = Value
Exit Sub
End If
Next
Collection(0) = Collection(0) + 1
Collection(Collection(0) * 2 - ... <a href="https://www.liveinternet.ru/users/fixin/post9416687/">Читать далее...</a>
, 17 2005 . 14:34
+
!
VB Script ( Outlook ) Collection.
, .
, , :
Public Function MyCollection_Create()
Dim a(200)
a(0) = 0
MyCollection_Create = a
End Function
Public Sub MyCollection_Add(Collection, Value, Key)
For i = 1 To Collection(0)
If Collection(i * 2 - 1) = Key Then
Collection(i * 2) = Value
Exit Sub
End If
Next
Collection(0) = Collection(0) + 1
Collection(Collection(0) * 2 - 1) = Key
Collection(Collection(0) * 2) = Value
End Sub
Public Function MyCollection_Get(Collection, Key)
Set MyCollection_Get = Nothing
For i = 1 To Collection(0)
If Collection(i * 2 - 1) = Key Then
MyCollection_Get = Collection(i * 2)
Exit Function
End If
Next
End Function
Collection Scripting Dictionary:
Dim d 'Create a variable
Set d = CreateObject(Scripting.Dictionary)
d.Add "a", "Athens" 'Add some keys and items
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
<a href="https://www.liveinternet.ru/users/fixin/post9269943/">Переход с BAT/CMD на VBS для чайников</a><br/>Долгое время не решался перейти в административных скриптах на VBS все корячился на BAT/CMD.
Пока в один прекрасный момент не собрался-таки и не решился. :)
Все очень просто - открываешь например Access или Excel, нажимаешь Alt+F11, заходишь в редактор VBA, пишешь нужный тебе код, отлаживаешь, а потом просто вставляешь его в файл с расширением VBS и запускаешь. Вуаля!
Вот пример скрипта, который заменяет файл src файлом dst но только если дата изменения файла dst позже, чем у файла src.
Как видите, я весь код сначала отладил в отладчике VBA, потом закомментировал лишние SUB. Прогресс н... <a href="https://www.liveinternet.ru/users/fixin/post9269943/">Читать далее...</a>
, 11 2005 . 16:11
+
VBS BAT/CMD.
- . :)
- Access Excel, Alt+F11, VBA, , , VBS . !
, src dst dst , src.
, VBA, SUB. , .
<a href="https://www.liveinternet.ru/users/fixin/post6211857/">Программисты мегафона...</a><br/>... продолжают удивлять широтой мысли.
На их сайте отправки SMS-сообщений есть код подтверждения доставки (нужно написать текстом то, что нарисовано на картинке):
[url]http://sms.megafonmoscow.ru/?status=ok[/url]
Однако для проверки используется java-script, что позволяет злоумышленникам легко и непринужденно извлекать этот код из самой страницы или же сразу же посылать значение в серверный скрипт, обходя значение java-script.
Короче, защита сделана по принципу - чтобы была.
Пользователей она напрягает, а от хакеров не защищает.
:kngt:
Или я ошибаюся?... <a href="https://www.liveinternet.ru/users/fixin/post6211857/">Читать далее...</a>
, 09 2005 . 18:34
+
<a href="https://www.liveinternet.ru/users/fixin/post5404361/">Нет просто слов.</a><br/>Опять эти выблядки из Мелкософта достали меня вдрызг.
Потратил три часа времени, чтобы научиться коннектиться из Access к таблицам Outlook, а оказалось, что при подсоединении через ADO доступны не все поля, блин. Например, у контакта я не могу прочитать его текстовое описание, трандец какой-то...
Какой кошмар!
Остается или начать мучать OLE или вообще не мучаться.:tnp:... <a href="https://www.liveinternet.ru/users/fixin/post5404361/">Читать далее...</a>
, 22 2005 . 16:51
+
.
, Access Outlook, , ADO , . , , -...
!
OLE .
<a href="https://www.liveinternet.ru/users/fixin/post5371279/">TextBox в VBA</a><br/>Прочитать значение поля TextBox независимо от того, стоит на нем фокус или нет:
Столкнулся с тем, что у поля textBox значение реквизита text можно почитать когда на нем стоит фокус, а когда фокус не стоит, то можно прочитать только value. Когда на объекте стоит фокус, в value хранится предыдущее значение, поэтому читать всегда value не годится.
Вот такой кусок кода даст всегда актуальное значение текстового поля:
con_text = Trim(con.Value)
On Error Resume Next
con_text = Trim(con.Text)
On Error GoTo 0... <a href="https://www.liveinternet.ru/users/fixin/post5371279/">Читать далее...</a>
, 20 2005 . 11:04
+
TextBox , :
, textBox text , , value. , value , value .
:
con_text = Trim(con.Value)
On Error Resume Next
con_text = Trim(con.Text)
On Error GoTo 0
<a href="https://www.liveinternet.ru/users/fixin/post4589476/">Мне помогли прибить XML</a><br/>Короче сегодня полдня мучался, чтобы XML записывал в правильной кодировке Win-1251.
Добрые люди подсказали:
var pi = xmldoc.createProcessingInstruction("xml",
" version='1.0' encoding="win-1251");
xmldoc.appendChild(pi);
Ура, вот исходная статья:
To change the encoding that the XML DOM Save method uses, you need to create an XML declaration with an encoding attribute at the top of your document as follows:
var pi = xmldoc.createProcessingInstruction("xml",
" version='1.0' encoding='ISO-8859-1'");
xmldoc.appendChild(pi);
... <a href="https://www.liveinternet.ru/users/fixin/post4589476/">Читать далее...</a>
, 25 2005 . 19:45
+
, XML Win-1251.
:
var pi = xmldoc.createProcessingInstruction("xml",
" version='1.0' encoding="win-1251");
xmldoc.appendChild(pi);
, :
To change the encoding that the XML DOM Save method uses, you need to create an XML declaration with an encoding attribute at the top of your document as follows:
var pi = xmldoc.createProcessingInstruction("xml",
" version='1.0' encoding='ISO-8859-1'");
xmldoc.appendChild(pi);
When you call the save method, you will then get an ISO-8859-1 encoded file as follows:
å
Now, be careful you don't let the XML property confuse you. The XML property returns a Unicode string. If you call the XML property on the DOMDocument object after creating the ISO-8859-1 encoding declaration, you will get the following Unicode string back:
å
Notice that the ISO-8859-1 encoding declaration is gone. This is normal. The reason it did this is so that you can turn around and call LoadXML with this string and it will work. If it does not do this, LoadXML will fail with the error message: "Switch from current encoding to specified encoding not supported."
<a href="https://www.liveinternet.ru/users/fixin/post4530645/">Фильтры в аутглюке.</a><br/>Теперь я умею программно менять фильтр в OUTLOOK.
То есть считываю свойство XML, меняю фильтр на свой и - войла!
И вот как это можно использовать - например пройтись процедуркой по всем элементам папки, запомнить EntryID всех элементов, которые есть в папке и потом поставить фильтр, указав перечень нужных элементов типа EntryID in (a,b,c,d,,,f)
Нашел форум по аутлуку (на англицком) [url]www.outlookcode.com[/url]. Там хороший и внимательный админ.
... <a href="https://www.liveinternet.ru/users/fixin/post4530645/">Читать далее...</a>
, 21 2005 . 18:24
+
OUTLOOK.
XML, - !
- , EntryID , , EntryID in (a,b,c,d,,,f)
( )
www.outlookcode.com . .