1. var $body_temp=array();
PHP是弱类型语言,C#是强类型语言,所以这句对应的C#不确定
如果 body_temp 元素类型未知:object[] body_temp = new object[0] {};object 是 C# 的公共基类如果 body_temp 元素类型已知(例如是整数):int[] body_temp = new int[0] {};2. var $month_num=array(“Jan”=>1,”Feb”=>2,”Mar”=>3);C# 的数组都是整数下标的,这句在C#中没有直接对应的,只能用两个数组模拟:string[] month_num_idx = new string[3] { "Jan", "Feb", "Mar" };
int[] month_num_val = new int[3] { 1, 2, 3 };而且定位元素时还要加一些算法3. function aa($head=null,$body=null,$content_num=-1){
              if(!$head and !$body)  //????????
         }C# 没有孤立的函数,只有类方法,可以用“静态”方法模拟(但是C#不支持缺省参数):public class Test
{
    public static aa(object head, object body, int content_num)
    {
        //不知道你的 head, body 的具体类型,PHP的布尔“真”“假”值与C#的含义不同,所以对应代码不好写
    }
}4. unset($this->body_temp);C# 无所谓 unset,因为PHP是解释语言,而C#是编译语言5. if(!eregi(“multipart”,$this->body_type))手头没有手册,不知道 eregi 对应的 C# 方法,$this->body_type 应该对应 this.body_type6. $tmp_body=implode($this->body_temp,”\r\n”);不知道 implode 对应的 C# 函数7. $this-body=array();
         $this->body[$this->tem_num][content_id]=””;
         $this->body[$this->tem_num][type]=$this->body_type;
8. $lines=count(this->body_temp);lines = this.body_temp.Length;9. eregi($boundary.”--”,$this->body_temp[$i]);
10. eregi(“Content-ID:[ ]*\<(.*)\>”,$comm.,$reg);
11. $content.=$this->body_temp[$I].”\r\n”;假设 this->body_temp[I] 已经是 string 类型:content = content + this->body_temp[I] + "\r\n";