English (United States) Magyar (Magyarország)
You are hereBlogs
Register   |  Login
  
  
  
szept. 13

Written by: SUF
2005. 09. 13. 20:04 

Pár napja írtam már a fenti címről. Akkor úgy gondoltam, hogy egy JScript példa elég lesz. Közben rájöttem, hogy .Net környezetben ez kevés (a típusosság miatt jóval több dolgot meg kell adni). Ezért most itt egy C# metódusként megírt példa (a referenciák közé fel kell venni az ADO és a CDO COM Objektumokat):
public static CDO.Message LoadMsgFile(string FileName) 
{ 
    CDO.Message Msg = new CDO.MessageClass(); 
    ADODB.Stream MsgStream = new ADODB.Stream(); 
    MsgStream.Type = ADODB.StreamTypeEnum.adTypeBinary; 
    MsgStream.Open((object)System.Type.Missing, 
        ADODB.ConnectModeEnum.adModeUnknown, 
        ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified, 
        "",""); 
    MsgStream.LoadFromFile(FileName); 
    Msg.DataSource.OpenObject(MsgStream,"_Stream"); 
    return Msg; 
}

Tags:
 Comments

In order to add comments, you must register on the site. Simply select the Register link in the top right portion of the screen and enter your contact information. Once you are logged-in, you will be able to add comments.

Already registered? Click here to login to the site. 

 

 Keresés