第一個(gè)問(wèn)題 qq聊天室 必須能 用vb都可以做

十載的江孜網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開(kāi)發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。全網(wǎng)營(yíng)銷(xiāo)推廣的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整江孜建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)公司從事“江孜網(wǎng)站設(shè)計(jì)”,“江孜網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
第二個(gè)問(wèn)題 vb.net插入數(shù)學(xué)公式 可以把這些公式封裝到一個(gè)類(lèi)中,調(diào)用就是了
可以的,服務(wù)器用WIN 2000/NT了,語(yǔ)言只是個(gè)工具而已,想實(shí)現(xiàn)的目的用所選的工具都能實(shí)現(xiàn),只是實(shí)現(xiàn)周期的長(zhǎng)短了。vb可以做任何事,比如高級(jí)應(yīng)用,線程等,但要用到API,如果用C/c++就不用API 了,所以工具的選擇還是蠻重要的!
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using System.Diagnostics;
namespace QQLogin
{
public partial class QQLoginForm : Form
{
public QQLoginForm()
{
InitializeComponent();
}
UserInfo ui;
private void button1_Click(object sender, EventArgs e)
{
//單用戶登陸
if (ui == null)
{
ui = new UserInfo();//如果沒(méi)有提取出來(lái)對(duì)象,就創(chuàng)建一個(gè)
}
if (ui != null)
{
ui.Username = this.txtUser.Text.Trim();
ui.Password = this.txtPwd.Text;
ui.Type = this.cboType.Text == "正常" ? "41" : "40";
if (this.ValidateInput())
{//驗(yàn)證是否輸入完全
if (string.IsNullOrEmpty(ui.Path))
{//判斷是否有QQ路徑,如果沒(méi)有就打開(kāi)對(duì)話框來(lái)選擇一下
DialogResult dr = this.opfQQ.ShowDialog();
if (dr == DialogResult.OK)
{
ui.Path = opfQQ.FileName;//將選擇的路徑賦值給對(duì)象
this.LoginQQ(ui.Username, ui.Password, ui.Type, ui.Path);//登陸QQ
}
}
else
{
this.LoginQQ(ui.Username, ui.Password, ui.Type, ui.Path);
}
}
SerializeHelper.SerializeUserInfo(ui);//每次登陸都序列化保存一次
}
}
private bool ValidateInput()
{//驗(yàn)證是否輸入完整
if (this.txtUser.Text == "")
{
this.txtUser.Focus();
return false;
}
else if(this.txtPwd.Text=="")
{
this.txtPwd.Focus();
return false;
}
return true;
}
private void LoginQQ(string user,string pwd,string type,string path)
{//登陸QQ的命令,通過(guò)CMD命令來(lái)執(zhí)行
Process MyProcess = new Process();
//設(shè)定程序名
MyProcess.StartInfo.FileName = "cmd.exe";
//關(guān)閉Shell的使用
MyProcess.StartInfo.UseShellExecute = false;
//重定向標(biāo)準(zhǔn)輸入
MyProcess.StartInfo.RedirectStandardInput = true;
//重定向標(biāo)準(zhǔn)輸出
MyProcess.StartInfo.RedirectStandardOutput = true;
//重定向錯(cuò)誤輸出
MyProcess.StartInfo.RedirectStandardError = true;
//設(shè)置不顯示窗口
MyProcess.StartInfo.CreateNoWindow = true;
//執(zhí)行強(qiáng)制結(jié)束命令
MyProcess.Start();
MyProcess.StandardInput.WriteLine(path+" /start QQUIN:"+user+" PWDHASH:" + EncodeHash.pwdHash(pwd) + " /stat:"+type);//直接結(jié)束進(jìn)程ID
MyProcess.StandardInput.WriteLine("Exit");
}
private void btnExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void txtUser_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar '0' || e.KeyChar '9')e.KeyChar!=8)
{//只能輸入數(shù)字和退格鍵
e.Handled = true;
}
}
private void QQLoginForm_Load(object sender, EventArgs e)
{
LoadInfo();//單用戶獲取
}
private void LoadInfo()
{//單用戶獲取
ui = SerializeHelper.DeserializeUserInfo();//返回獲取后對(duì)象
if (ui != null)
{
this.txtUser.Text = ui.Username;//填充文本框
this.txtPwd.Text = ui.Password;//填充密碼框
this.cboType.SelectedIndex = ui.Type == "41" ? 0 : 1;//選擇登陸方式
}
else
{
this.cboType.SelectedIndex = 0;
}
}
private void btnConfig_Click(object sender, EventArgs e)
{
ConfigForm cf = new ConfigForm();
cf.ShowDialog();
LoadInfo();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace QQLogin
{
public partial class ConfigForm : Form
{
UserInfo ui;
public ConfigForm()
{
InitializeComponent();
}
private void txtPath_Click(object sender, EventArgs e)
{//點(diǎn)擊一次文本框,彈出一次對(duì)話框來(lái)選擇QQ路徑
DialogResult dr = this.opfQQ.ShowDialog();
if (dr == DialogResult.OK)
{
this.txtPath.Text = opfQQ.FileName;
}
}
private bool ValidateInput()
{//驗(yàn)證是否輸入完整
if (this.txtUser.Text == "")
{
this.txtUser.Focus();
return false;
}
else if (this.txtPwd.Text == "")
{
this.txtPwd.Focus();
return false;
}
else if (this.txtPath.Text == "")
{
return false;
}
return true;
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void ConfigForm_Load(object sender, EventArgs e)
{
LoadInfo();
}
private void btnSave_Click(object sender, EventArgs e)
{
ui = new UserInfo();
ui.Username = this.txtUser.Text.Trim();
ui.Password = this.txtPwd.Text;
ui.Type = this.cboType.Text == "正常" ? "41" : "40";
ui.Path = this.txtPath.Text;
if (this.ValidateInput())
{
SerializeHelper.SerializeUserInfo(ui);
this.Close();
}
}
private void LoadInfo()
{
ui = SerializeHelper.DeserializeUserInfo();
if (ui != null)
{
this.txtUser.Text = ui.Username;
this.txtPwd.Text = ui.Password;
this.cboType.SelectedIndex = ui.Type == "41" ? 0 : 1;
this.txtPath.Text = ui.Path;
}
else
{
this.cboType.SelectedIndex = 0;
}
}
}
}
分享文章:vb.net發(fā)送qq,vbnet byref
轉(zhuǎn)載源于:http://chinadenli.net/article36/dsgjppg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、企業(yè)網(wǎng)站制作、網(wǎng)站導(dǎo)航、手機(jī)網(wǎng)站建設(shè)、軟件開(kāi)發(fā)、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)