杂锦代码_1

Dim lngUserRecno As Long
    lngUserRecno 
= IsValidADSUser()
    
If lngUserRecno < 0 Then
        
If intADSAuthFlag = ADSAUTH_SYSTEM Then
            
Dim sIISAuth As String
            sIISAuth 
= m_pfs.dfVntToTrimStr(m_objRequest.ServerVariables("AUTH_TYPE"))
            
If sIISAuth = "" Then
                
'm_objResponse.Write "ADS Error: Your setting is forbidden to anonymous user."
                m_objResponse.Status = "401 Unauthorized - Logon failed"
                m_objResponse.AddHeader "WWW-Authenticate""BASIC"
                
                m_objResponse.
End
                
Exit Function
            
End If
        
End If
        lngUserRecno 
= ADSAuthUser()
    
End If
    
    
If lngUserRecno <= 0 Then
        
If intADSAuthFlag = ADSAUTH_SYSTEM Then
            m_objResponse.Redirect sErrorNoRightUrl
            m_objResponse.
End
        
Else
            m_objResponse.Redirect sLogonUrl 
& "?ReturnUrl=" & m_objServer.URLEncode(sReturnUrl)
            m_objResponse.
End
        
End If
    
End If


Dim strSimplifiedChinese, strTraditionalChinese As String
        strSimplifiedChinese 
= "我是中国人!"
        strTraditionalChinese = StrConv(strSimplifiedChinese, VbStrConv.TraditionalChinese) '简转繁
        Console.Write(strTraditionalChinese)
        strSimplifiedChinese 
= StrConv(strTraditionalChinese, VbStrConv.SimplifiedChinese) '繁转简
        Console.Write(strSimplifiedChinese)


'Set bps = .BodyPart.BodyParts
'
Set bp = bps.Add
'
    bps.Delete bp


Sub SaveMessageToFile(iMsg As CDO.Message, Filepath As String)
    
Dim Stm As New Stream
    Stm.Open
    Stm.Type 
= adTypeText
    Stm.Charset 
= "US-ASCII"
    
    
Dim iDsrc As IDataSource
    
Set iDsrc = iMsg
    iDsrc.SaveToObject Stm, 
"_Stream"
    
    Stm.SaveToFile Filepath, adSaveCreateOverWrite
    
End Sub


Private Sub CreateFolder(sName As String, aDefaultContentClass As Variant, sMAPIFolderClass As String)
    
Dim recADO As New ADODB.Record
    recADO.Open sName, connADO, adModeReadWrite, adCreateCollection
    recADO.Fields(
"DAV:contentclass").Value = "urn:content-classes:folder"
    recADO.Fields("http://schemas.microsoft.com/exchange/outlookfolderclass"= sMAPIFolderClass
    recADO.Fields(
"urn:schemas-microsoft-com:exch-data:expected-content-class").Value = aDefaultContentClass
    recADO.Fields(
"urn:schemas-microsoft-com:exch-data:schema-collection-ref").Value = sCustomSchemaFolder
    recADO.Fields.Update
    recADO.Close
End Sub


Email Creation:

Two ways you might attack it.
1. You can do a global event sink on a mailbox store.  Capturing creation
events of certain folders would likely give you mailbox creation events.
2. Use the LDAP change notification mechanism to monitor AD for changes that
indicate mailbox creations.  This 
is potentially easier because you can
watch in a 
single place instead of on every store of every server.  This
also will catch the situation where an account gets 
"Mailbox enabled" but
the folders don
't actually get created on the store until much much later.

Andy

"David Eales" <d.eales@Staff.covcollege.ac.uk> wrote in message
news:035d01c2bf2b$408c4a30$8af82ecf@TK2MSFTNGXA03
> Hi,
>
> Is there a way to do an event sink so that when a new
> mailbox is created a notification is sent to a certain
> address via email.
>
> Thanks

Exchange_Delete_Attachment

Set objAttachments = objMessage.Attachments
 
If objAttachments.Count <> 0 Then
  
For Each objAttachment In objAttachments
   
With objAttachment
    
If .FileName = "TEST.DOC" Then
     objAttachments.Delete objAttachment
     objMessage.DataSource.Save
    
End If
   
End With
  
Next
 
End If


Exchange里各文件的作用.txt

* .edb,.stm
priv1.ebd,priv1.stm   MailBox Store
pub1.ebd, pub1.stm    
Public Folder Store
My store.ebd,My Store.stm  Your Store

With Exchange 2000each Exchange 2000 database is contained in two linked files — the .edb and the .stm. The .edb file contains folders, tables, and indexes for messaging data and MAPI messages and attachments. The .stm file contains native Internet content. When performing backup and restore procedures, you must always treat these two files as one.

* .log

E0000001.
LOG
E000????.
LOG
res1.
log
res2.
log
Exchange 
2000 also uses write-ahead transaction log files to ensure the efficient processing of Exchange 2000 data. Write-ahead is the process of writing transactions sequentially in transaction logs before writing them in bulk to the database files. Because log files store copies of the transactions, this process ensures that transactions are never lost before they are written to the databases in bulk.
Each storage group also maintains two log files (Res1.log and Res2.log) that function as placeholders for extra disk space on the hard disk containing the log files. If the drive containing the log files runs out of disk space, Res1.log and Res2.log allow the database files in the storage group to shut down in a consistent state.

* .chk
E00.CHK
E00.
log
Checkpoint files store information that indicates when a transaction 
is successfully saved to the database files on the hard disk. A checkpoint file is maintained for the series of log files within each storage group. Separate E<nn>.chk files (where <nn> refers to the log file prefix for the storage group) point to the oldest log file that has all transactions successfully committed to the database
   
posted @ 2005-02-03 01:21  Benny Ng  阅读(276)  评论(0)    收藏  举报