how to define the token with specific format
I am creating the web service authentication. When the client login with user name and password, server will give the token or public key back to the client in order to request the webservice function. I like to define the token format (randomcode开发者_开发技巧+userid+dateformat(yyyy-mm-dd)+randomcode). Can you give me the way with the example? The following is my code.
string token = Guid.NewGuid().ToString();
HttpRuntime.cache.Add(
token,Username,Null,
System.Web.Caching.Cache.NoAbsoluteExpiration,
TimeSpam.FromMinutes(60),
System.Web.Caching.CacheItemPriority.NotRemovable,
null);
Best Regards, Wai Mar Khaing
I'm not sure your question is about this, but I try:
string token =
Guid.NewGuid().ToString() +
Username +
DateTime.Now.ToString("yyyy-mm-dd") +
Guid.NewGuid().ToString()
精彩评论