本程序就是在文本框中输入两个数然后相加,在label标签中显出结果.

解决方案 »

  1.   

    地址:http://chs.gotdotnet.com/quickstart/
    描述:本站点是微软.NET技术的快速入门网站,我们不必再安装.NET Framework中的快速入门示例程序,直接在网上查看此示例即看。
    ****************************************************
    名称:微软官方.NET指导站点
    地址:http://www.gotdotnet.com/
    描述:上面的站点是本站的一个子站点,本站点提供微软.NET官方信息,并且有大量的用户源代码、控件下载,微软.NET开发组的人员也经常在此站点发表一些指导性文章。
    ****************************************************
    名称:SourceForge
    地址:http://www.sourceforge.net
    描述:世界上最大的Open Source项目在线网站,上面已经有.NET的各种大型Open Source项目上千件,包括SharpDevelop、NDoc、Mono等都是在此站点发布最新源代码信息。
    ****************************************************
    名称:CodeProject
    地址:http://www.codeproject.com
    描述:很多非官方的中小型示例源代及文章,相当全面,基本上我们想要的各种方面的资料都可以在此处查找。
    ****************************************************
    名称:Fabrice's weblog 
    地址:http://dotnetweblogs.com/FMARGUERIE/Story/4139.aspx
    描述:这是一个WebLog形式的在线日志网站,定期更新,包括.NET相关的工具、混淆器、反编译器等各种信息,十分值得收藏。
    ****************************************************
    名称:
    地址:http://www.aspalliance.com/aldotnet/examples/translate.aspx 
    描述:c#翻译为vb.net,提供一个文本框,将你的C#源代码贴进去,就可以帮你翻译成VB.NET语法。
    vb.NET 转c# 工具
    http://www.developerfusion.com/utilities/convertvbtocsharp.aspx
    ****************************************************
    名称:CSharpHelp
    地址:http://www.csharphelp.com
    描述: 专业的C#语言在线帮助网站,主要提供C#语言方面的技术文章。专业性很强。
    ****************************************************
    名称:DotNet247
    地址:http://www.dotnet247.com
    描述:最好的索引网站,分别按照门类及命名空间的索引,也提供了Microsoft KB知识库。 补记——
    ****************************************************
    名称:ASP.NET
    地址:http://www.asp.net
    描述:微软.NET webform的老巢,资料和实例代码都非常难得。
    ****************************************************
    名称:微软.NET Winform
    地址:http://www.windowsforms.net/
    描述:微软.NET Winform的老巢。
    ****************************************************
    名称:微软 KnowledgeBase 
    地址:http://support.microsoft.com/
    描述:微软知识库,开发的时候遇到的怪问题,可能会在这里找到答案。
    ****************************************************
    名称:MSDN 
    地址:http://msdn.microsoft.com/
    描述:这个就不用多说了吧,虽然出了中文MSDN,但是资料还是不够全,英文的就什么都有了。
    ****************************************************
    名称:HotScripts 
    地址:http://www.hotscripts.com/
    描述:Welcome to HotScripts.com, the net’s largest PHP, CGI, Perl, JavaScript and ASP script collection and resource web portal. We currently have 24,004 scripts across 11 different programming languages and 1,240 categories, as well as links to books, articles, as well as programming tips and tutorials. 
    ****************************************************
    名称:ASPAlliance 
    地址:http://www.aspalliance.com/
    描述:提供相当丰富的文章和示例代码,思路匮乏的时候可以找找思路
    ****************************************************
    名称:CSDN文档中心 
    地址:http://dev.csdn.net/
    描述:中文的,资料还算丰富,可以作为国内首选。
    ****************************************************
    名称:DOTNET中华网 
    地址:http://www.aspxcn.com/
    描述:2002-2003年的时候这个站点很不错的,不过现在好像管理不得力,有点疲软,资料更新也不过及时,论坛里人也不够热心了,因为希望它好起来,所以列出来。资料都比较老,不过有些D版的东西还可以。提供很多学习代码。
    ****************************************************
    名称:中国DotNet俱乐部 
    地址:http://www.chinaspx.com/
    描述:有点公司背景的网站,很健壮,资料更新及时,比较丰富。论坛解答也不错。
    ****************************************************
    名称:【孟宪会之精彩世界】 
    地址:http://dotnet.aspx.cc/
    描述:MS-MVP的个人站点,包括了他所有的经验文章,还是很值得一看的。
    ****************************************************
    名称:dotNET Tools.org 
    地址:http://www.dotnettools.org
    描述:ccboy,也就是CSDN的小气的神的站点,里面有很多关于.NET等的好东东。
    ****************************************************
    名称:博客堂 
    地址:http://blog.joycode.com/
    描述:半官方性质的MS-MVP汇集blog,大家可以在这里接触到最新的技术,了解发展趋势,对技术的探索等等,优秀的文章。
    ****************************************************
    名称:DotNetBips.com - Applying .NET 
    地址:http://www.dotnetbips.com/
    描述:该站点的文章,涉及到了整个.NET,从底层的IL到语言到架构,文章很多,质量还不错。
    ****************************************************
    名称:C# Frequently Asked Questions
    地址:http://blogs.msdn.com/csharpfaq/
    描述:The C# team posts answers to common questions
    ****************************************************
    再补记--------
    ****************************************************
    名称:正则表达式
    地址:http://www.regexplib.com/
    描述:  正则表达式学习站点 
    ****************************************************
    名称:WINDOW FORMS FAQ 
    地址:http://www.syncfusion.com/FAQ/WinForms/
    描述:常见的forms faq问题,很多问题都可以在这里找到答案。 
    ****************************************************
    名称:ASP.NET 常用类库说明
    地址:http://www.123aspx.com/rotor/default.aspx
    描述:不用多说,看标题就知道是关于asp.net的名称空间的
    ****************************************************
    名称:ASP.NET System.Web.Mail 
    地址:http://www.systemwebmail.com/faq/3.8.aspx
    描述:邮件发送常见问题解决方法http://csharp-source.net/open-source/web-mail
    ****************************************************
    名称:VB.NET & C# 比较
    地址:http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html
    描述:VB.NET跟C#语法区别
    ****************************************************
    名称:VB.NET架构师 BLOG
    地址:http://panopticoncentral.net/
      

  2.   

    哈哈哈,“hello 楼主”推荐一些网站http://blog.csdn.net/trnbo/archive/2004/10/21/145770.aspx
      

  3.   

    http://blog.csdn.net/t_jian/articles/69574.aspx
    http://weblogs.asp.net/ssivakumar/archive/2003/09/17/27930.aspx
    http://www.gotdotnet.com/team/csharp/learn/faq/
    http://msdn.microsoft.com/vcsharp/team/language/default.aspx
      

  4.   

    公共类的代码:
    包含了许多好的方法
    using System;
    using System.Data.SqlClient;
    using System.Data;
    using System.Net;
    using System.Xml;
    using System.Windows.Forms;
    namespace mzk
    {
    /// <summary>
    /// pub 的摘要说明。
    /// </summary>
    public class pub
    {
    public SqlConnection SqlCn=new SqlConnection();
    public SqlCommand SqlCm=new SqlCommand();
    //连接数据库
    public bool Connect(string SqlStr)
    {
    if(SqlCn.State==ConnectionState.Open)
    {
    return true;
    }
    SqlCn.ConnectionString=SqlStr;
    try
    {
    SqlCn.Open();
    return true;
    }
    catch(Exception err)
    {
    Console.WriteLine(err.Message);
    return false;
    }
    }
    //连接数据库
    public bool Connect()
    {
    if(SqlCn.State==ConnectionState.Open)
    {
    return true;
    }
    //SqlCn.ConnectionString="workstation id=马泽魁_网络部;packet size=4096;user id=sa;data source=localhost;persist security info=True;initial catalog=good;password=801225";
    SqlCn.ConnectionString="user id=sa;data source=localhost;initial catalog=good;password=801225";
    //SqlCn.ConnectionString="user id=sa;data source=陈海霞_市场网络;initial catalog=killonline";
    try
    {
    SqlCn.Open();
    return true;
    }
    catch(Exception err)
    {
    Console.WriteLine(err.Message);
    return false;
    }
    }
    //关闭数据库
    public bool Close()
    {
    if(SqlCn.State==ConnectionState.Closed)
    {
    return true;
    }
    try
    {
    SqlCn.Close();
    return true;
    }
    catch(Exception err)
    {
    Console.WriteLine(err.Message);
    return false;
    }

    }
    //取得某个数据记录的字段值
    public string getValue(string sql,string fieldName)
    {
    string result="";
    SqlCommand TempCm=new SqlCommand();
    SqlDataReader TempRead=null;
    try
    {
    if(SqlCn.State==ConnectionState.Closed)
    {
    Connect();
    }
    TempCm.Connection=SqlCn;
    TempCm.CommandText=sql;
    TempRead=TempCm.ExecuteReader();
    if(TempRead.Read())
    {
    try
    {
    result=TempRead[fieldName].ToString().Trim();
    }
    catch(Exception err)
    {
    Console.WriteLine(err.Message);
    result="";
    }
    finally
    {
    TempRead.Close();
    this.Close();
    }
    } }
    catch(Exception err)
    {
    Console.WriteLine(err.Message);
    result="";
    this.Close();
    }
    return result;
    }
    //取得够个数据记录的字段值
    public string getValue(string sql,int fieldIndex)
    {
    return "本函数正在建设中";
    }

    //执行Sql语句
    public bool ExecuteSql(string sql)
    {
    SqlCommand TempCm=new SqlCommand();
    if(this.Connect())
    {
    SqlTransaction tran=SqlCn.BeginTransaction();
    TempCm.Connection=SqlCn;
    TempCm.Transaction=tran;
    TempCm.CommandText=sql;
    try
    {
    TempCm.ExecuteNonQuery();
    tran.Commit();
    return true;
    }
    catch(Exception err)
    {
    Console.WriteLine(err.Message);
    tran.Rollback();
    return false;
    }
    finally
    {
    this.Close();
    } }
    return false;
    }
    //获取远程接口生成的XML文档
    public string getXml(string url)
    {
    try
    {
    WebClient webClient=new WebClient();
    byte[] downLoad=webClient.DownloadData(url);
    string getData=System.Text.UnicodeEncoding.Default.GetString(downLoad);
    return getData;
    }
    catch
    {
    return "";
    }
    }
    //查询符合条件的记录
    public void GetSubUser()
    {
    SqlCommand TempCm=new SqlCommand();
    SqlDataReader TempRead=null;
    try
    {
    if(SqlCn.State==ConnectionState.Closed)
    {
    Connect();
    }
    TempCm.Connection=SqlCn;
    TempCm.CommandText="select * from GetUserInfo_View";
    TempRead=TempCm.ExecuteReader();
    while(TempRead.Read())
    {
    string LoginName=TempRead[""].ToString();
    string QueryDate=TempRead[""].ToString();
    string ProductCode=TempRead[""].ToString();
    string ProductName=TempRead[""].ToString();
    string IcpCode=TempRead[""].ToString();
    string IcpVerifyCode="";
    this.SubAddFee(LoginName,QueryDate,ProductCode,ProductName,IcpCode,IcpVerifyCode);
    } }
    catch(Exception err)
    {
    System.Console.Write(err.Message);
    }
    finally
    {
    this.Close();
    } }
    //增加用户续费过程
    public void SubAddFee(string LoginName,string QueryDate,string ProductCode,string ProductName,string IcpCode,string IcpVerifyCode)
    {
    string TReturnCode="";     //返回码,1:查询成功;2:非本ICP的产品,无法查询 3:本时段不开放查询功能,无法查询
    string TLoginName="";      //用户在Vnet上的登陆名
    string THaveSub="";       //是否有订购记录,1:是;0:否
    string TProductCode="";   //CP发布在Vnet上的产品编码,需要事先定义好(注:此字段在SP19 release之后才有)
    string TProductName="";   //ICP发布在Vnet上的产品的名称,需要事先定义好
    string TBeginTime="";     //订购开始时间,在有订购记录的情况下不为空,格式为yyyy-MM-dd HH:mm:ss,其中HH取值为0-23
    string TEndTime="";       //订购结束时间,在有订购记录的情况下不为空,格式为yyyy-MM-dd HH:mm:ss,其中HH取值为0-23
    string TReSubStatus="";   //自动续订标识,0:自动续订;1:非自动续订
    /*
     * 得到所有变量的值
     */
    XmlDocument XmlDoc=new XmlDocument();
    XmlDoc.LoadXml(getXml(""));//取得远程接口所生成的XML文档
    //XmlDoc.Load("c:\\ini.xml");
    XmlNode Xnode=XmlDoc.SelectSingleNode("Result");
    if(Xnode!=null)
    {
    XmlElement xe=(XmlElement) Xnode;
    TReturnCode=xe.GetAttribute("VnetLoginName");
    TLoginName=xe.GetAttribute("vnetloginname");
    THaveSub=xe.GetAttribute("havesub");
    TProductCode=xe.GetAttribute("productcode");
    TProductName=xe.GetAttribute("productname");
    TBeginTime=xe.GetAttribute("begintime");
    TEndTime=xe.GetAttribute("endtime");
    TReSubStatus=xe.GetAttribute("resubstatus");
    }
    SqlParameter[] SqlPar;
    SqlPar=new SqlParameter[10];
    SqlPar[0].ParameterName="dff";
    SqlPar[0].SqlDbType=System.Data.SqlDbType.Int;
    }
    //执行存储过程
    public int ExecProc(string ProcName,System.Data.SqlClient.SqlParameter[] SqlPar,int Output)
    {
    if(this.Connect())
    {
    SqlTransaction Tran=this.SqlCn.BeginTransaction();
    try
    {
    //System.Data.SqlClient.SqlParameter TempPar=new SqlParameter();
    this.SqlCm.Connection=this.SqlCn;
    this.SqlCm.CommandType=System.Data.CommandType.StoredProcedure;
    this.SqlCm.CommandText=ProcName;
    this.SqlCm.Transaction=Tran;
    for(int a=0;a<SqlPar.Length;a++)
    {
    this.SqlCm.Parameters.Add(SqlPar[a]);
    }
    this.SqlCm.ExecuteNonQuery();
    SqlPar[Output].Direction=System.Data.ParameterDirection.Output;
    Tran.Commit();
    return int.Parse(SqlPar[Output].Value.ToString());
    }
    catch
    {
    Tran.Rollback();
    return 10;
    }
    finally
    {
    this.Close();
    }
    }
    return 11;
    }
    }
    }
      

  5.   

    http://www.aspxboy.com/code
    我开始学的时候做的 代码比较烂
      

  6.   

    你要找例子代码是不是?去msdn搜索哦samolecode,安逸的很啊。包括petshop,duwamish之类的。
      

  7.   

    101 C# Code Samples
    微软官方提供的小例子,
    初学者可以看看!
    http://www.microsoft.com/downloads/details.aspx?FamilyID=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en
      

  8.   

    to:楼主 
    虽然抵制Hello world! 但是楼主也不用把那么好的代码贴出来啊
    呵呵
      

  9.   

    msdn+google 基础的东西应该没有问题