可能是编码不对吧,其实你这种情况就像两个不想干的程序读写同一个文件,因该没有什么问题的

解决方案 »

  1.   

    已经解决了,我在js里用escape编码,然后在c#理解码;在c#里我用的是自编过程,不知道有没有现成的类来实现类似功能?js里:
    document.cookie = "storeinfo=" + escape( clipData );c#里解码:
    public string unescape( string str )
    {
      string result = "";
      for( int i = 0; i < str.Length; i ++ )
      {
        if( str[ i ] == '%' )
        {
          int flag = str[ i + 1 ] == 'u' ? 1 : 0;
          result += ( char )( Int32.Parse( str.Substring( i + flag + 1, flag * 2 + 2 ), NumberStyles.HexNumber ) );
          i += flag * 3 + 2;
        }
        else
        {
          result += str[ i ];
        }
      }
      return result;
    }