小编lin*_*ean的帖子

与单一网络应用程序相反的词是什么?

我说的是一个 Web 应用程序,它将独立的客户端应用程序(单页应用程序)和服务器端 RESTful API 之间的资源分开。

我正在考虑多片式,但这似乎并没有在这种情况下使用。

architecture terminology web-applications semantics

5
推荐指数
1
解决办法
2136
查看次数

GUID 必须是 16 字节长

我试图重载一个使用 Guid 作为其参数的方法,另一个方法以字符串作为其参数。

    // read a student object from the dictionary
    static public User Retrieve(Guid ID)
    {
        User user;
        // find the Guid in the Dictionary
        user = Users[ID];
        return user;
    }

    static public User Retrieve(string Email)
    {
        User user;
        Guid id;
        // find the Guid in the Dictionary
        using (SHA1 sha1 = SHA1.Create())
        {
            byte[] hash = SHA1.ComputeHash(Encoding.Default.GetBytes(Email));
            id = new Guid(hash);
        }
        user = Users[id];
        return user;
    }
Run Code Online (Sandbox Code Playgroud)

测试结果 结果消息:测试方法 SRS.CRUDUsers.UpdateStudent 抛出异常:System.ArgumentException:GUID 的字节数组长度必须正好为 16 个字节。

测试方法:

    public void …
Run Code Online (Sandbox Code Playgroud)

c# overloading

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