我需要用 BinaryFormatter 序列化静态类,代码如下:
    void Serialize()
    {
        IFormatter formatter = new BinaryFormatter();
        using (FileStream s = File.Create("ServerInfo.bin"))
            formatter.Serialize(s, Server); // ERROR: Error 44 'Server' is a 'type' but is used like a 'variable'
    }
我怎样才能解决这个问题?