|
|
|
vbs+помогите
|
|||
|---|---|---|---|
|
#18+
Помогите разобраться как запустить этот скрипт из cmd Private Function SignedMessage ( ByVal sFrom As String, ByVal sTo As String, ByVal sSubject As String, ByVal sBody As String, ByVal sAttachmentName As String, ByVal sAttachmentFile As String, ByVal sCertificateSerialNumber As String As CDO.Message ) Const csAttachment As String = "attachment;filename=""<FileName>""" Const csAttachmentFileName As String = "<FileName>" Const csContentDisposition As String = "urn:schemas:mailheader:content- disposition" Dim abSignatureData() As Byte Dim oSignature As CDO.IBodyPart Dim oSignedData As CAPICOM.SignedData Dim oStream As ADODB.Stream Set SignedMessage = New CDO.Message With SignedMessage .ReplyTo = sFrom .From = sFrom .To = sTo .Subject = sSubject 'Create main body (= text + attachment). With .BodyPart .ContentMediaType = "multipart/signed;protocol=""application/x- pkcs7-signature"";micalg=SHA1" With .AddBodyPart .ContentMediaType = "multipart/mixed" With .AddBodyPart .ContentMediaType = "text/plain;charset=""iso-8859-1""" Set oStream = .GetDecodedContentStream With oStream .WriteText sBody .Flush .Close End With Set oStream = Nothing End With With .AddBodyPart .ContentMediaType = "application/pdf" .ContentTransferEncoding = "base64" With .Fields .Item(csContentDisposition) = Replace(csAttachment, csAttachmentFileName, sAttachmentName) .Update End With Set oStream = .GetDecodedContentStream With oStream .LoadFromFile sAttachmentFile .Flush .Close End With Set oStream = Nothing End With End With 'Now add the signature. 'Don't get content to sign until the message's structure is complete. Set oSignature = .AddBodyPart With oSignature .ContentMediaType = "application/x-pkcs7-signature" .ContentTransferEncoding = "base64" With .Fields .Item(csContentDisposition) = Replace(csAttachment, csAttachmentFileName, "smime.p7s") .Update End With 'Now create the signature as a byte array. 'Doing this with a byte array variable otherwise Stream.Write will report an error. Set oSignedData = New CAPICOM.SignedData With oSignedData .Content = MessageContent (SignedMessage.GetStream.ReadText) abSignatureData = .Sign(CertificateSigner (sCertificateSerialNumber), True, CAPICOM_ENCODE_BINARY) End With Set oSignedData = Nothing Set oStream = .GetDecodedContentStream With oStream .Write abSignatureData .Flush .Close End With Set oStream = Nothing End With End With End With End Function ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.12.2006, 22:45 |
|
||
|
vbs+помогите
|
|||
|---|---|---|---|
|
#18+
Форматирование хотя бы сделайте, а? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.12.2006, 06:43 |
|
||
|
vbs+помогите
|
|||
|---|---|---|---|
|
#18+
вот сделала за него Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.12.2006, 07:54 |
|
||
|
vbs+помогите
|
|||
|---|---|---|---|
|
#18+
возможно ли заставить работать из cmd ?? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.12.2006, 09:47 |
|
||
|
|

start [/forum/topic.php?fid=60&fpage=254&tid=2164799]: |
0ms |
get settings: |
7ms |
get forum list: |
9ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
47ms |
get topic data: |
6ms |
get forum data: |
1ms |
get page messages: |
23ms |
get tp. blocked users: |
1ms |
| others: | 265ms |
| total: | 363ms |

| 0 / 0 |
