Codice PHP:
//MAIN.cs
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace VS_Gestione_Esami
{
static class Program
{
/// <summary>
/// Punto di ingresso principale dell'applicazione.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Login login = new Login();
DialogResult dr = login.ShowDialog();
login.Dispose();
if (dr == DialogResult.OK)
Application.Run(new MainForm());
return;
}
}
}
//Login.cs
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Configuration;
using System.Security.Cryptography;
using VS_Gestione_Esami.Forms;
using VS_Gestione_Esami.core;
namespace VS_Gestione_Esami
{
public partial class Login : Form
{
#region PInvoke
private const uint _Blend = 0x00080000;
private const uint _Activate = 0x00020000;
[DllImport("user32.dll")]
private static extern bool AnimateWindow(
IntPtr hWnd,
uint time,
uint flags
);
#endregion
Utility utility = new Utility();
public Login()
{
InitializeComponent();
}
private void Login_Load(object sender, EventArgs e)
{
AnimateWindow(this.Handle, 350, _Blend);
if (File.Exists("DatiAgendaElettronica.xml"))
{
try
{
//Carica il profilo Utente
//this._core.Load(this.lvwTodoDate);
}
catch
{
}
}
}
private void versioneToolStripMenuItem_Click(object sender, EventArgs e)
{
Informazioni info = new Informazioni();
info.Show();
}
private void esciToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
void LoginTextControlsTextChanged(object sender, EventArgs e)
{
if ((this.loginNomeTextBox.TextLength > 0) && (this.loginPasswdTextBox.TextLength > 3))
{
this.btnLogin.Enabled = true;
}
else
{
this.btnLogin.Enabled = false;
}
}
private void btnLogin_Click(object sender, EventArgs e)
{
utility.User = this;
Utente student = new Utente();
if (utility.caricaDati(student, utility.User.loginNomeTextBox.Text + ".xml") == true)
{
this.Dispose();
}
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Registrazione reg = new Registrazione();
reg.ShowDialog();
}
}
public class Utente
{
private String nome;
private String cognome;
private String pwd;
private String matr;
private String facoltà;
public void setNomeUtente(String nm)
{
this.nome = nm;
}
public void setCognomeUtente(String cgnm)
{
this.cognome = cgnm;
}
public void setPassUtente(String pass)
{
this.pwd = pass;
}
public void setMatricolaUtente(String codm)
{
this.matr = codm;
}
public void setFacoltàUtente(String fac)
{
this.facoltà = fac;
}
public String getNomeUtente()
{
return this.nome;
}
public String getCognomeUtente()
{
return this.cognome;
}
public String getPassUtente()
{
return this.pwd;
}
public String getMatricolaUtente()
{
return this.matr;
}
public String getFacoltàUtente()
{
return this.facoltà;
}
}
}
//MainForm.cs
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Configuration;
using System.Security.Cryptography;
using VS_Gestione_Esami.Forms;
using VS_Gestione_Esami.core;
namespace VS_Gestione_Esami
{
public partial class MainForm : Form
{
#region PInvoke
private const uint _Blend = 0x00080000;
private const uint _Activate = 0x00020000;
[DllImport("user32.dll")]
private static extern bool AnimateWindow(
IntPtr hWnd,
uint time,
uint flags
);
#endregion
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
AnimateWindow(this.Handle, 350, _Blend | _Activate);
}
private void esciToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
Credo che sia tutto...