小编Hub*_*ubi的帖子

EWS + Exchange 2007:检索内嵌图像

使用EWS托管API在C#中工作,我们无法有效地检索存储为内联附件的图像.

端点是显示带有内嵌图像的电子邮件,作为面板中完全形成的html页面.我们目前的代码:

     string sHTMLCOntent = item.Body;

      FileAttachment[] attachments = null;

      if (item.Attachments.Count != 0)
      {
        attachments = new FileAttachment[item.Attachments.Count];
        for (int i = 0; i < item.Attachments.Count; i++)
        {
          string sType = item.Attachments[i].ContentType.ToLower();
          if (sType.Contains("image"))
          {
            attachments[i] = (FileAttachment)item.Attachments[i];
            string sID = attachments[i].ContentId;
            sType = sType.Replace("image/", "");
            string sFilename = sID + "." + sType;
            string sPathPlusFilename = Directory.GetCurrentDirectory() + "\\" + sFilename;
            attachments[i].Load(sFilename);
            string oldString = "cid:" + sID;
            sHTMLCOntent = sHTMLCOntent.Replace(oldString, sPathPlusFilename);
          }
        }
      }
Run Code Online (Sandbox Code Playgroud)

(来源:http: …

c# inline image exchange-server-2007 exchangewebservices

2
推荐指数
1
解决办法
5331
查看次数

C++中的构造函数错误

我刚刚开始学习cpp.我创建了一个包含2个构造函数的类.当我在ubuntu上运行此命令时: g++ -Wall -g main.cpp car.cpp -o a 我收到错误按摩:

> "In file included from main.cpp:2:0: car.h:10:15: 
error: expected ‘)’ before ‘,’ token  car(string,string,int);

In file included from car.cpp:1:0: car.h:10:15: 
error: expected ‘)’ before ‘,’ token car(string,string,int);

car.cpp:10:9: error: expected constructor, destructor, or type conversion before ‘(’ token  car::car(string brand, string color, int cost){  "
Run Code Online (Sandbox Code Playgroud)

我不明白为什么我收到此错误信息,我的代码有什么问题?请帮我.

这是我的代码:

这是一个h文件

#include <iostream>
#include <string>
#pragma once

class car{

    public:
    car();
    car(string,string,int);
    int get_cost();
    std::string get_brand();
    std::string get_color();

    private:
    std::string newbrand;
    std::string newcolor;
    int …
Run Code Online (Sandbox Code Playgroud)

c++

-2
推荐指数
1
解决办法
190
查看次数