Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to add new Guid to a String List?
- public Guid Login(string userName, string password)
- {
- Guid result = new Guid();
- if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password))
- {
- userName = userName.Trim();
- password = password.Trim();
- Member member = BusinessDb.LoginDbJobs.GetUser(userName);
- if (member != null && member.PasswordDb == password)
- {
- result = Guid.NewGuid();
- Members.Live.Add(result); //--->Object reference not set to an instance of an object.
- }
- }
- return result;
- }
- if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password))
- {
- userName = userName.Trim();
- password = password.Trim();
- Member member = BusinessDb.LoginDbJobs.GetUser(userName);
- if (member != null && member.PasswordDb == password)
- {
- result = Guid.NewGuid();
- Members.Live.Add(result); //--->Object reference not set to an instance of an object.
- }
- }
- return result;
- }
- ...
- public class Members
- {
- public static List< Guid > Live;
- }
- ...
- public class Members
- {
- public static List<Guid> Live = new List<Guid>();
- }
- public class Members
- {
- public static readonly List<Guid> Live = new List<Guid>();
- }
Add Comment
Please, Sign In to add comment