-
大小: 16.66MB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2023-07-31
- 語言: C#
- 標(biāo)簽: winform??仿QQ??SQL數(shù)據(jù)庫??
資源簡介
這是我寫的第一個基于winform的仿QQ軟件,由于學(xué)習(xí)winform時間不長,也是第一次編寫,代碼的構(gòu)造和貫通性不是很好,請諒解......有什么問題可以和我交流,共同促進(jìn)。 只需將數(shù)據(jù)庫文件附加到SQL里面,更改軟件里面的連接數(shù)據(jù)庫的字符串即可.........主要涉及SQl數(shù)據(jù)庫.....
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?System.Data.SqlClient;
using?System.IO;
namespace?登陸
{
????public?partial?class?AddFriends?:?Form
????{
????????public?string?receTxt?=?““;//接收值;
????????Form1?f1?=?new?Form1();
????????mainform?m1?=?new?mainform();
????????public?AddFriends()
????????{
????????????InitializeComponent();
????????????skinButtom1.Enabled?=?false;
????????????pictureBox1.Image?=?Properties.Resources.Min_Normal;
????????????pictureBox2.BackColor?=?Color.Transparent;
????????????pictureBox1.BackColor?=?Color.Transparent;
????????????pictureBox2.Image?=?Properties.Resources.Close_Normal;
????????}
????????#region-------------------------------把數(shù)據(jù)庫中的表數(shù)據(jù)全部羅列出來----------------------------
????????private?void?Reserch()
????????{
????????????Form1?f1?=?new?Form1();?
????????????using?(SqlConnection?sql1?=?f1.Getsql())
????????????{
????????????????sql1.Open();
????????????????using?(SqlCommand?sqlcomm?=?sql1.CreateCommand())
????????????????{
????????????????????sqlcomm.CommandText?=?“select?*from?Table_注冊“;
????????????????????SqlDataAdapter?sqlda?=?new?SqlDataAdapter(sqlcomm);
????????????????????DataSet?ds?=?new?DataSet();
????????????????????sqlda.Fill(ds);
????????????????????DataTable?dt?=?ds.Tables[0];
????????????????????for?(int?i?=?0;?i?????????????????????{
????????????????????????DataRow?dr?=?dt.Rows[i];
????????????????????????listBox1.Items.Add?(?dr[“username“].ToString()+“\t“+dr[“nicheng“].ToString?()+“\t“
????????????????????????????+dr[“gexing“].ToString?()+“\t“+dr[“adress“].ToString?());
???????????????????????
????????????????????}
????????????????}
????????????}
????????}
????????#endregion
????????#region---------------------------------單個查找--------------------------------------------
????????byte[]?bufferByte;
????????Image?image;
????????private?void?OneReserch()
????????{
?????????????Form1?f1?=?new?Form1();
?????????????using?(SqlConnection?sql1?=?f1.Getsql())
?????????????{
?????????????????sql1.Open();
????????????????
?????????????????using?(SqlCommand?sqlcomm?=?sql1.CreateCommand?())
?????????????????{
?????????????????????sqlcomm.CommandText?=?“select?usernamenicheng?from?Table_注冊?where?username=@userid?“;
?????????????????????sqlcomm.Parameters.Add(new?SqlParameter(“@userid“?UserIdTextBox1.Text));
?????????????????????SqlDataReader?re?=?sqlcomm.ExecuteReader();
?????????????????????if?(re.Read())
?????????????????????{
?????????????????????????waterTextBox1.Text?=?re[“nicheng“].ToString();
????????????????????????
?????????????????????????waterTextBox1.Enabled?=?false;
?????????????????????????skinButtom1.Enabled?=?true;
?????????????????????}
?????????????????????else
?????????????????????{
?????????????????????????MessageBox.Show(“不好意思,沒有找到這個人!“);
??????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????3145728??2014-03-28?12:13??JIANGY?QQ\數(shù)據(jù)庫數(shù)據(jù)\testone.mdf
?????文件????1048576??2014-03-28?12:13??JIANGY?QQ\數(shù)據(jù)庫數(shù)據(jù)\testone_log.ldf
?????文件??????12015??2014-04-09?14:57??JIANGY?QQ\登陸\AddFriendForm.cs
?????文件??????15255??2014-04-09?14:22??JIANGY?QQ\登陸\AddFriendForm.Designer.cs
?????文件??????64648??2014-04-09?14:22??JIANGY?QQ\登陸\AddFriendForm.resx
?????文件???????1150??2013-10-29?08:14??JIANGY?QQ\登陸\bin\Debug\0.ico
?????文件???????1150??2013-10-29?08:14??JIANGY?QQ\登陸\bin\Debug\1.ico
?????文件???????1150??2013-10-29?08:14??JIANGY?QQ\登陸\bin\Debug\2.ico
?????文件???????1150??2013-10-29?08:14??JIANGY?QQ\登陸\bin\Debug\3.ico
?????文件???????1150??2013-10-29?08:14??JIANGY?QQ\登陸\bin\Debug\4.ico
?????文件???????1150??2013-10-29?08:14??JIANGY?QQ\登陸\bin\Debug\5.ico
?????文件?????302352??2013-10-05?02:38??JIANGY?QQ\登陸\bin\Debug\Microsoft.QualityTools.Testing.Fakes.dll
?????文件??????40960??2007-09-14?15:51??JIANGY?QQ\登陸\bin\Debug\SideBar.dll
?????文件?????607232??2013-04-26?16:25??JIANGY?QQ\登陸\bin\Debug\SkinForm.dll
?????文件???????1406??2013-10-30?08:58??JIANGY?QQ\登陸\bin\Debug\sys.ico
?????文件????8846336??2014-04-09?17:06??JIANGY?QQ\登陸\bin\Debug\登陸.exe
?????文件?????237056??2014-04-09?17:06??JIANGY?QQ\登陸\bin\Debug\登陸.pdb
?????文件??????24224??2014-04-09?17:07??JIANGY?QQ\登陸\bin\Debug\登陸.vshost.exe
?????文件???????7109??2014-04-08?13:54??JIANGY?QQ\登陸\ChatForm.cs
?????文件??????10566??2014-04-08?13:54??JIANGY?QQ\登陸\ChatForm.Designer.cs
?????文件??????12144??2014-04-08?13:54??JIANGY?QQ\登陸\ChatForm.resx
?????文件???????2147??2014-04-04?19:14??JIANGY?QQ\登陸\ConfigForm.cs
?????文件???????3020??2014-04-04?19:13??JIANGY?QQ\登陸\ConfigForm.Designer.cs
?????文件??????31912??2014-04-04?19:13??JIANGY?QQ\登陸\ConfigForm.resx
?????文件?????144384??2014-04-01?13:30??JIANGY?QQ\登陸\FakesAssemblies\SideBar.1.0.2813.28543.Fakes.dll
?????文件????????514??2014-04-01?13:30??JIANGY?QQ\登陸\FakesAssemblies\SideBar.1.0.2813.28543.Fakes.fakesconfig
?????文件???????2130??2014-04-01?13:30??JIANGY?QQ\登陸\FakesAssemblies\SideBar.1.0.2813.28543.Fakes.messages
?????文件?????192043??2014-04-01?13:30??JIANGY?QQ\登陸\FakesAssemblies\SideBar.1.0.2813.28543.Fakes.xm
?????文件??????19571??2014-04-09?17:01??JIANGY?QQ\登陸\LoginForm.cs
?????文件??????21254??2014-04-08?17:19??JIANGY?QQ\登陸\LoginForm.Designer.cs
............此處省略262個文件信息
評論
共有 條評論