随笔分类 - C#
摘要:系统数据库路径:C:\Users\Administrator\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\MSSQLLocalDB 用户数据库默认路径:C:\Users\Administrator 连接字符串: <c
阅读全文
摘要:解决方法:关闭解决方案,打开解决方案所在文件夹,打开以下文件夹:.vs\ConsoleApp7\FileContentIndex,然后删除里面的所有文件,再重新在VS中打开解决方案重新生成即可
阅读全文
摘要:示例1: class E { public IEnumerable MyGetEnumerator1() { yield return 1; } public IEnumerable<int> MyGetEnumerator2() { yield return 1; yield return 2;
阅读全文
摘要:1 using System; 2 3 namespace ConsoleApp3_Test 4 { 5 6 internal class Aa 7 { 8 9 static void Main(string[] args) 10 { 11 Stock stock = new Stock("THPW
阅读全文
摘要:public static readonly int b = a + 1; public static readonly int a = 1; public static readonly int c = 1; public static readonly int d = c + 1; public
阅读全文
摘要:<Window x:Class="WpfApp1.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/x
阅读全文
摘要:<WrapPanel x:Name="WrapPanelName"> <Border BorderThickness="1" BorderBrush="Blue"> <TextBox x:Name="tbFindAncestor" Text="{Binding RelativeSource={Rel
阅读全文
摘要:<Window x:Class="WpfApp2.BindingTest5" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2
阅读全文
摘要:部分代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using S
阅读全文
摘要:一、SQL SERVER 连接字符串语法: 1、SQL SERVER验证(两种写法)(安全连接) string connStr = "Data Source=.;Initial Catalog=DatabaseName;User Id=sa;Password=123"; 或 string connS
阅读全文
摘要:class A { public int num = 3; public void m1(B b) { b.m2(this); } } class B { public void m2(A a) { Console.WriteLine(a.num); } } class Test { public
阅读全文
摘要:转载自:https://blog.csdn.net/fightHHA/article/details/81626383 https://blog.csdn.net/weixin_49199646/article/details/109492763?spm=1001.2101.3001.6650.8&
阅读全文
摘要:1、方法重写 class Parent { public void m1() { m2(); } public virtual void m2() { Console.WriteLine("I am Parent."); } } class Child : Parent { public overr
阅读全文