-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathProgram.cs
61 lines (59 loc) · 1.76 KB
/
Program.cs
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
/*
* QR code generator library (.NET)
*
* Copyright (c) Manuel Bleichenbacher (MIT License)
* https://github.com/manuelbl/QrCodeGenerator
*
* Demo creating a QR code containing a vCard.
*
*/
using MixERP.Net.VCards;
using MixERP.Net.VCards.Models;
using MixERP.Net.VCards.Serializer;
using MixERP.Net.VCards.Types;
using Net.Codecrete.QrCodeGenerator;
using System.Collections.Generic;
using System.IO;
namespace VCardDemo
{
class Program
{
static void Main()
{
var vcard = new VCard
{
Version = VCardVersion.V3,
FirstName = "Robin",
LastName = "Hood",
Organization = "Sherwood Inc.",
Addresses = new List<Address>
{
new Address {
Type = AddressType.Work,
Street = "The Major Oak",
Locality = "Sherwood Forest",
PostalCode = "NG21 9RN",
Country = "United Kingdom",
}
},
Telephones = new List<Telephone>
{
new Telephone {
Type = TelephoneType.Work,
Number = "+441623677321"
}
},
Emails = new List<Email>
{
new Email
{
Type = EmailType.Smtp,
EmailAddress = "[email protected]"
}
}
};
var qrCode = QrCode.EncodeText(vcard.Serialize(), QrCode.Ecc.Medium);
File.WriteAllText("vcard-qrcode.svg", qrCode.ToSvgString(3));
}
}
}