
C#
FYANGFEI
各人有各人的隐晦与皎洁
展开
-
关于ASP技术的增删改查demo
222222222222原创 2020-10-21 21:44:44 · 180 阅读 · 1 评论 -
ListBox实现简单选课系统
1.效果图异常处理正解 //添加新的课程 private void btnAddCourse_Click(object sender, EventArgs e) { bool exit = false; if (txtCourse.Text == "") ...原创 2019-11-01 22:21:22 · 513 阅读 · 0 评论 -
C#输入三条边判断是否为三角形
题目基类Shape类是一个表示形状的抽象类,GetArea ()为求图形面积的函数。请从Shape类派生三角形类(Triangle),并给出具体的求面积函数,并在主函数中多态地实现调用。 public abstract class Shape{} public class Triangle : Shape { p...原创 2019-10-29 21:50:38 · 3238 阅读 · 0 评论 -
VS2010,aspx连接SQLever2008R2,把数据库中的数据展示到网页
首先在自己的SQLsever中建立一个叫test1的数据库,(我的数据库是用的Windows身份验证所以连接字符串后面没有SQLSever的账号和密码) protected void Page_Load(object sender, EventArgs e) { SqlConnection conn =new SqlConnection...原创 2019-10-24 22:01:44 · 620 阅读 · 0 评论 -
asp.net连接sqlever2008R2,
SqlConnection con = new SqlConnection("Data Source = (local);DataBase=Student;Trusted_Connection = true"); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.CommandTe...原创 2019-09-29 21:54:07 · 347 阅读 · 0 评论 -
判断一个数是否为素数C#实现
int t, i; t = Convert.ToInt32(Console.ReadLine()); bool resoult = true;//假设是素数 for ( i = 2; i < t-1; i++)//最小的素数是2, { i...原创 2019-09-26 17:40:41 · 3500 阅读 · 0 评论 -
编写程序练习List<T>的基本使用
编写程序练习List<T>的基本使用 /* * 4.编写程序练习List<T>的基本使用: ①创建一个只能容纳string对象的名为names的List集合; ②按顺序向集合中添加5个字符串对象:“Joh...原创 2019-09-26 14:56:35 · 4016 阅读 · 0 评论 -
(C#)实现对n个整数组成的一维数组按逆序重新存储并输出
对n个整数组成的一维数组按逆序重新存储并输出(n<10) int[] arr = new int[9]; int i,j,n,temp; //读入一个整数n Console.WriteLine("请输入n!"); try...原创 2019-09-26 14:43:56 · 6815 阅读 · 0 评论 -
数组中的位置交换
题目一个数组有8个元素,将前3个元素通过移动串到后3个位置上,如果其初始数据为:12345678不增加数组,也不增加数组的存储单元,通过移动数组元素将数组变化为:45678123 int[] arr = new int[] { 1,2,3,4,5,6,7,8}; int temp ;//用于后面替换 ...原创 2019-09-26 14:03:13 · 6487 阅读 · 0 评论 -
对一维数组的替换和冒泡排序
一位数组中,数组的删除不太方便,可以对其进行替换using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace yy3{ class Program { static void ...原创 2019-09-19 21:53:31 · 342 阅读 · 1 评论