先将字符串转换为Decimal类型,再用Decimal 模数运算符取被2除后的余数,然后反顺排列就行了。p.s.
Decimal 模数运算符  [C#]
返回两个指定 Decimal 值相除所得的余数。
[C#]
public static decimal operator %(
   decimal d1,
   decimal d2
);
参数 [C#, C++] 
d1 
Decimal(被除数)。 
d2 
Decimal(除数)。 
返回值
d1 除以 d2 所得的 Decimal 余数。

解决方案 »

  1.   

    Decimal.GetBits
    public static int[] GetBits(
       decimal d
    );
      

  2.   

    string getBinString(int val)
    {
        char[] chs=new char[]{'0','1'};
        int s;//商
        int y=val;//余数
        System.Text.StringBuilder str=new System.Text.StringBuilder();
        while(y>0)
        {
    s=y/2;//得到商
    y=y%2;//得到余数
    str.Insert(0,chs[y]);
    if(s>=2)
    {
        y=s;
    }
    else
    {
       if(s>0) str.Insert(0,chs[s]);
       y=0;
    }
        }
        return str.ToString();
    }
      

  3.   

    this.textBox1.Text =Convert.ToString(15,2);
      

  4.   

    二进制:
    this.textBox1.Text =Convert.ToString(15,2);
    十六进制:
       int temp = Convert.ToInt32("11110000",2);
       this.textBox1.Text =Convert.ToString(temp,16);