FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CRMSDKExample/ClientConfiguration.cs at main · JoseFuentesDevAp/CRMSDKExample · GitHub
JoseFuentesDevAp
/
CRMSDKExample
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
CRMSDKExample
/
ClientConfiguration.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (31 loc) · 1.1 KB
Breadcrumbs
CRMSDKExample
/
ClientConfiguration.cs
Copy path
File metadata and controls
35 lines (31 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using
System
.
Diagnostics
;
using
System
.
Xml
.
Serialization
;
public
class
ClientConfiguration
{
public
string
ClientId
{
get
;
set
;
}
public
string
ClientSecret
{
get
;
set
;
}
public
string
TenantId
{
get
;
set
;
}
public
string
User
{
get
;
set
;
}
public
string
Password
{
get
;
set
;
}
public
string
Resource
{
get
;
set
;
}
public
static
ClientConfiguration
LoadFromXml
(
string
filePath
)
{
if
(
!
File
.
Exists
(
filePath
)
)
{
throw
new
FileNotFoundException
(
$
"El archivo de configuración no existe:
{
filePath
}
"
)
;
}
try
{
XmlSerializer
serializer
=
new
XmlSerializer
(
typeof
(
ClientConfiguration
)
)
;
using
(
FileStream
fileStream
=
new
FileStream
(
filePath
,
FileMode
.
Open
,
FileAccess
.
Read
)
)
{
ClientConfiguration
config
=
(
ClientConfiguration
)
serializer
.
Deserialize
(
fileStream
)
;
return
config
;
}
}
catch
(
Exception
ex
)
{
throw
new
Exception
(
$
"Error al cargar la configuración desde XML:
{
ex
.
Message
}
"
,
ex
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL