-
Notifications
You must be signed in to change notification settings - Fork 6
/
WebService.asmx
131 lines (113 loc) · 3.25 KB
/
WebService.asmx
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<%@ WebService Language="C#"
Class="Tun.DataService" %>
using System.Web.Services;
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
namespace Tun
{
public class DataService: WebService
{
[WebMethod]
public bool Login(string userName, string password, string deobiet, out string userID)
{
if (ValidDeoBiet(deobiet))
{
if (userName == "ttttt" && password == "ttttt")
{
object[] objArray = { true, "ttttt" };
userID = (string)objArray[1];
//Write(userName + ", login,,,,,,,,,,,,,,,");
return (bool)objArray[0];
}
else if (userName == "ccccc" && password == "ccccc")
{
object[] objArray = { true, "ccccc" };
userID = (string)objArray[1];
//Write(userName + ", login,,,,,,,,,,,,,,,");
return (bool)objArray[0];
}
else
{
userID = "";
return false;
}
}
else
{
userID = "";
return false;
}
}
[WebMethod]
public bool StartTerminal(string userID, string accountPair)
{
//Write(userID + ", start," + accountPair + ",,,,,,,,,,,,,,");
return true;
}
[WebMethod]
public bool StopTerminal(string userID, string accountPair)
{
//Write(userID + ", stop," + accountPair + ",,,,,,,,,,,,,,");
return false;
}
[WebMethod]
public bool AllowRun(string userID, string ibetAccount, string sbobetAccount)
{
return true;
}
[WebMethod]
public bool ChangePassword(string userID, string oldPassword, string newPassword)
{
return true;
}
[WebMethod]
public void AddTransaction(
string a1,
string a2,
string a3,
string a4,
string a5,
string a6,
string a7,
string a8,
bool a9,
bool a10,
bool a11,
bool a12,
bool a13,
bool a14,
string a15,
DateTime a16)
{
Write(a1 + ",bet," + a2 + "," + a3 + "," + a4 + "," + a5 + "," + a6 + "," + a7 + "," + a8 + "," + a9 + "," + a10 + "," + a11 + ","
+ a12 + "," + a13 + "," + a14 + "," + a15 + "," + a16);
}
public static void Log(string logMessage, TextWriter w)
{
w.Write("\r\n");
w.Write("{0} {1}", DateTime.Now.ToLongTimeString(),
DateTime.Now.ToShortDateString() + ",");
w.Write("{0}", logMessage);
//w.WriteLine("-------------------------------");
// Update the underlying file.
w.Flush();
}
public static void Write(string text)
{
using (StreamWriter w = File.AppendText("F://Inetpub//vhosts//apbenvironment.com//httpdocs//log.csv"))
{
Log(text, w);
w.Close();
}
}
public static bool ValidDeoBiet(string deobiet)
{
//78-84-3C-99-66-EE
if (macs.Contains(deobiet))
return true;
return false;
}
}
}