Menu

[r40]: / trunk / WhatsappClient / Classes / WhatsAppAccount.cs  Maximize  Restore  History

Download this file

63 lines (54 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* by Swen Kooij aka Kirk - swenkooij@gmail.com
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// Represents a WhatsApp account
/// </summary>
public class WhatsappAccount
{
/// <summary>
/// The country code
/// </summary>
public string CountryCode { get; set; }
/// <summary>
/// The phone number belonging to this account.
/// </summary>
public string Phonenumber { get; set; }
/// <summary>
/// The phone numbers with the country code
/// </summary>
public string FullPhonenumber { get; set; }
/// <summary>
/// The password that belongs to this account
/// </summary>
public string Password { get; set; }
/// <summary>
/// The nickname, can be changed every time
/// </summary>
public string Nickname { get; set; }
/// <summary>
/// Default class constructor
/// </summary>
/// <param name="_Phonenumber">The full phonenumber, including country code.</param>
/// <param name="_Password">The password assigned to the phone number.</param>
public WhatsappAccount(string _CountryCode, string _Phonenumber, string _Password, string _Nickname)
{
CountryCode = _CountryCode;
FullPhonenumber = CountryCode + _Phonenumber.Replace("0", "");
Phonenumber = _Phonenumber;
Password = _Password;
Nickname = _Nickname;
}
/// <summary>
/// Returns the full jabber id
/// </summary>
/// <returns>Jabber ID (Jid)</returns>
public string GetFullJid()
{
return string.Format("{0}@{1}", FullPhonenumber, WhatsConstants.WhatsAppServer);
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.