Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tynab committed Oct 31, 2022
1 parent 7e8e796 commit bf6ccb8
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 95 deletions.
2 changes: 1 addition & 1 deletion Loginside FYAN Bot GUI/Loginside FYAN Bot GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<ItemGroup>
<PackageReference Include="SkiaSharp.Extended.UI.Maui" Version="2.0.0-preview.61" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0-rc.2.22472.3" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="7.0.0-rc.2.22472.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<ApplicationVersion>1.0.1.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Loginside FYAN Bot Service/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
6 changes: 2 additions & 4 deletions Loginside FYAN Bot Service/Script/IBotService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;

namespace Loginside_FYAN_Bot_Service.Script
namespace Loginside_FYAN_Bot_Service.Script
{
public interface IBotService : IDisposable
public interface IBotService
{
/// <summary>
/// Bot log on user and log in inside.
Expand Down
31 changes: 18 additions & 13 deletions Loginside FYAN Bot Service/Script/Service/BotService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Loginside_FYAN_Bot_Service.Script.Service
public class BotService : IBotService
{
#region Fields
public readonly IWebDriver _driver = new ChromeDriver();
private readonly IAppConfigService _appConfigService;
#endregion

Expand All @@ -31,25 +30,33 @@ public class BotService : IBotService
{
try
{
_driver.Manage().Window.Maximize();
_driver.Navigate().GoToUrl(link_ins);
Sleep(3000);
var elemId = _driver.FindElement(Id(id_inp_id));
// load page
using IWebDriver driver = new ChromeDriver();
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl(link_ins);
Sleep(7000);
// enter Id
var elemId = driver.FindElement(Id(id_inp_id));
elemId.SendKeys(id);
Sleep(300);
var elemPwd = _driver.FindElement(Id(id_inp_pwd));
// enter password
var elemPwd = driver.FindElement(Id(id_inp_pwd));
elemPwd.SendKeys(pwd);
Sleep(300);
var elemOtp = _driver.FindElement(Id(id_inp_otp));
// enter OTP
var elemOtp = driver.FindElement(Id(id_inp_otp));
elemOtp.SendKeys(GetOTP(secKey));
Sleep(300);
var elemBtnLogIn = _driver.FindElement(Id(id_btn_login));
// login
var elemBtnLogIn = driver.FindElement(Id(id_btn_login));
elemBtnLogIn.Click();
Sleep(3000);
var elemBtnChk = isChkIn ? _driver.FindElement(Id(id_btn_chkin)) : _driver.FindElement(Id(id_btn_chkout));
Sleep(7000);
WriteLog("Bot", "Logged!");
// check click
var elemBtnChk = isChkIn ? driver.FindElement(Id(id_btn_chkin)) : driver.FindElement(Id(id_btn_chkout));
elemBtnChk.Click();
Sleep(300);
WriteLog("Bot", "Checked!");
WriteLog("Bot", isChkIn ? "Checked in!" : "Checked out!");
}
catch (Exception ex)
{
Expand All @@ -61,8 +68,6 @@ public class BotService : IBotService
WriteLog("Bot", "Missing value!");
}
}).Start();

public void Dispose() => _driver.Dispose();
#endregion
}
}
6 changes: 1 addition & 5 deletions Loginside FYAN Bot Service/ServiceMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ protected override void OnStart(string[] args)
tmrBot.Elapsed += OnTmrBotEvent;
}

protected override void OnStop()
{
_botService.Dispose();
WriteLog("Bot", "Stopped!");
}
protected override void OnStop() => WriteLog("Bot", "Stopped!");
#endregion

#region Events
Expand Down
136 changes: 68 additions & 68 deletions Loginside FYAN Bot Setup/Loginside FYAN Bot Setup.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
"SccProvider" = "8:"
"Hierarchy"
{
"Entry"
{
"MsmKey" = "8:_49ED30400B35BB031E3CCE5B67F02B19"
"OwnerKey" = "8:_91B96E1E27364A00BDC038B00DCC42BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5AAEFDE7E68F4C02BA94FA67227D16A9"
Expand All @@ -34,7 +28,7 @@
"Entry"
{
"MsmKey" = "8:_62A60D437C591F8E22880696CA6F948B"
"OwnerKey" = "8:_83CB889D34242EC1FFBB62A4B9453C4B"
"OwnerKey" = "8:_BFEF0BF48D528840806446129176C71D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -52,13 +46,7 @@
"Entry"
{
"MsmKey" = "8:_81CD97B10B8755E9D60F51D719A988F7"
"OwnerKey" = "8:_83CB889D34242EC1FFBB62A4B9453C4B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_83CB889D34242EC1FFBB62A4B9453C4B"
"OwnerKey" = "8:_91B96E1E27364A00BDC038B00DCC42BE"
"OwnerKey" = "8:_BFEF0BF48D528840806446129176C71D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -81,12 +69,24 @@
}
"Entry"
{
"MsmKey" = "8:_9486A7EF351B0468D56D4F189F1CB4E3"
"OwnerKey" = "8:_91B96E1E27364A00BDC038B00DCC42BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_9C3DBA6C85284D7AA6826463F1CD57F0"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_BFEF0BF48D528840806446129176C71D"
"OwnerKey" = "8:_91B96E1E27364A00BDC038B00DCC42BE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_CD72190AF4114BCDA0C87EF6D198AF58"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
Expand All @@ -100,7 +100,7 @@
"Entry"
{
"MsmKey" = "8:_D048655F861BC95D0AB88E78E2A16BEC"
"OwnerKey" = "8:_83CB889D34242EC1FFBB62A4B9453C4B"
"OwnerKey" = "8:_BFEF0BF48D528840806446129176C71D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -118,7 +118,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_83CB889D34242EC1FFBB62A4B9453C4B"
"OwnerKey" = "8:_BFEF0BF48D528840806446129176C71D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -130,7 +130,7 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_49ED30400B35BB031E3CCE5B67F02B19"
"OwnerKey" = "8:_9486A7EF351B0468D56D4F189F1CB4E3"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand Down Expand Up @@ -305,37 +305,6 @@
}
"File"
{
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_49ED30400B35BB031E3CCE5B67F02B19"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:Otp.NET, Version=1.2.2.0, Culture=neutral, PublicKeyToken=38a48df817e173a6, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_49ED30400B35BB031E3CCE5B67F02B19"
{
"Name" = "8:Otp.NET.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Otp.NET.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_8F540F713A2E43B093E6EA54193259B2"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5AAEFDE7E68F4C02BA94FA67227D16A9"
{
"SourcePath" = "8:..\\res\\BSZoro.bmp"
Expand Down Expand Up @@ -438,20 +407,20 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_83CB889D34242EC1FFBB62A4B9453C4B"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8917E7CF60E3F7DCD184416AB16C710B"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:WebDriver, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
"ScatterAssemblies"
{
"_83CB889D34242EC1FFBB62A4B9453C4B"
"_8917E7CF60E3F7DCD184416AB16C710B"
{
"Name" = "8:WebDriver.dll"
"Name" = "8:System.IO.Compression.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:WebDriver.dll"
"SourcePath" = "8:System.IO.Compression.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_8F540F713A2E43B093E6EA54193259B2"
Expand All @@ -469,20 +438,40 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8917E7CF60E3F7DCD184416AB16C710B"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8B340B3392AE45C0B0859EAA83D45DAE"
{
"SourcePath" = "8:..\\res\\ic.ico"
"TargetName" = "8:ic.ico"
"Tag" = "8:"
"Folder" = "8:_8F540F713A2E43B093E6EA54193259B2"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_9486A7EF351B0468D56D4F189F1CB4E3"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
"AssemblyAsmDisplayName" = "8:Otp.NET, Version=1.2.2.0, Culture=neutral, PublicKeyToken=38a48df817e173a6, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_8917E7CF60E3F7DCD184416AB16C710B"
"_9486A7EF351B0468D56D4F189F1CB4E3"
{
"Name" = "8:System.IO.Compression.dll"
"Name" = "8:Otp.NET.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.IO.Compression.dll"
"SourcePath" = "8:Otp.NET.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_8F540F713A2E43B093E6EA54193259B2"
Expand All @@ -500,10 +489,10 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8B340B3392AE45C0B0859EAA83D45DAE"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9C3DBA6C85284D7AA6826463F1CD57F0"
{
"SourcePath" = "8:..\\res\\ic.ico"
"TargetName" = "8:ic.ico"
"SourcePath" = "8:..\\res\\BSLuffy.bmp"
"TargetName" = "8:BSLuffy.bmp"
"Tag" = "8:"
"Folder" = "8:_8F540F713A2E43B093E6EA54193259B2"
"Condition" = "8:"
Expand All @@ -520,10 +509,21 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9C3DBA6C85284D7AA6826463F1CD57F0"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_BFEF0BF48D528840806446129176C71D"
{
"SourcePath" = "8:..\\res\\BSLuffy.bmp"
"TargetName" = "8:BSLuffy.bmp"
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:WebDriver, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_BFEF0BF48D528840806446129176C71D"
{
"Name" = "8:WebDriver.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:WebDriver.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_8F540F713A2E43B093E6EA54193259B2"
"Condition" = "8:"
Expand All @@ -537,7 +537,7 @@
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CD72190AF4114BCDA0C87EF6D198AF58"
Expand Down Expand Up @@ -698,15 +698,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Loginside FYAN Bot"
"ProductCode" = "8:{22A64ED6-38E2-44B0-9A52-6158D411EEF6}"
"PackageCode" = "8:{72613F41-18EA-4A41-B6E0-950511FD5105}"
"ProductCode" = "8:{2F8C115A-C001-4D4D-B864-A5152D9B82C8}"
"PackageCode" = "8:{E5B40157-9A51-4220-AC77-0B73A6AD347D}"
"UpgradeCode" = "8:{7C1FB879-C5B4-4CC0-8829-5679463CDA3D}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0.0"
"ProductVersion" = "8:1.0.1"
"Manufacturer" = "8:YAN"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<img src="https://raw.githubusercontent.com/Tynab/Loginside-FYAN-Bot/main/pic/1.png" align="left" width="3%" height="3%"></img>
<div style="display:flex;">

- System.ServiceProcess.ServiceController » 6.0.0
- System.ServiceProcess.ServiceController » 7.0.0-rc.2.22472.3

</div>
<img src="https://raw.githubusercontent.com/Tynab/Loginside-FYAN-Bot/main/pic/5.png" align="left" width="3%" height="3%"></img>
Expand Down

0 comments on commit bf6ccb8

Please sign in to comment.