-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ef5160
commit 015072c
Showing
11 changed files
with
1,425 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
|
||
</configuration> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using OpenVkNetApi; | ||
using System.Configuration; | ||
|
||
namespace Spotify2OVK | ||
{ | ||
public partial class LoginForm : Form | ||
{ | ||
private OVkApi api = new(); | ||
private Configuration config; | ||
private AppSettingsSection app; | ||
public LoginForm() | ||
{ | ||
InitializeComponent(); | ||
MaximizeBox = false; | ||
config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | ||
app = config.AppSettings; | ||
} | ||
|
||
private void loginButton_Click(object sender, EventArgs e) | ||
{ | ||
if (!string.IsNullOrEmpty(login.Text) && !string.IsNullOrEmpty(password.Text) && !string.IsNullOrEmpty(instance.Text)) | ||
{ | ||
app.Settings.Add("ovkToken", api.Authorization(login.Text, password.Text, instance.Text).access_token); | ||
app.Settings.Add("ovkInstance", instance.Text); | ||
config.Save(ConfigurationSaveMode.Modified); | ||
ToMainForm(); | ||
} | ||
else | ||
{ | ||
MessageBox.Show("Заполните все поля"); | ||
} | ||
} | ||
private void ToMainForm() { | ||
MainForm form = new(); | ||
Hide(); | ||
form.ShowDialog(); | ||
Close(); | ||
} | ||
} | ||
} |
Oops, something went wrong.