随笔分类 -  .NET

1 2 3 4 5 ··· 8 下一页
摘要:数字或是字符可以随机, Insus.NET在这里实现颜色随机。 准备你需要随机的颜色: private static Color[] colors = { Color.AliceBlue, Color.AntiqueWhite, Color.Aqua, Color.Aquamarine, Color 阅读全文
posted @ 2021-06-27 14:45 Insus.NET 阅读(205) 评论(0) 推荐(0) 编辑
摘要:为了自动化,Insus.NET创建一个windows service来让其自动执行一些无人执实的事务。 项目产生之后,我们所看到的界面如下: 在左边栏位空白处,右击: 点击#4的"Add Installer": 点击#5,“View Code”: 接下来,我们对“Service1” 改一个好叫的名字 阅读全文
posted @ 2021-06-27 10:17 Insus.NET 阅读(200) 评论(0) 推荐(0) 编辑
摘要:昨天有练习对数字阵列进行排序,《C#阵列Array排序》https://www.cnblogs.com/insus/p/10825174.html 其实一切都弄得很复杂,array已经有2个方法OrderBy和OrderByDescending: 参考下面代码演示: int[] ints = { 1 阅读全文
posted @ 2019-05-08 10:06 Insus.NET 阅读(18025) 评论(3) 推荐(1) 编辑
摘要:五一假期回来,练习一下C#的一些知识,了解一下排序。 练习数据: 写一个类: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Ta 阅读全文
posted @ 2019-05-07 15:21 Insus.NET 阅读(3059) 评论(3) 推荐(2) 编辑
摘要:实现的功能以及效果如下: 样式代码: .divtable { display: table; border-collapse: collapse; border-spacing: 0; margin-right: auto; margin-left: auto; width: 100%; } .di 阅读全文
posted @ 2018-11-15 10:12 Insus.NET 阅读(1283) 评论(1) 推荐(3) 编辑
摘要:先来看看数据库表中的字段设计: 在数据库的数据类型为uniqueidentifier。而在程序中对应的数据类型为GUID。 property有get和set,也就是说能获取值也可以赋值。 阅读全文
posted @ 2016-12-14 23:17 Insus.NET 阅读(1090) 评论(0) 推荐(1) 编辑
摘要:相信很多人进行数据存储时,会遇上如标题的异常错误。 其实也不算上一个错误。 当你的程序中有宣告一个字段的数据类型为DateTime时,但你又没有赋值给它,就进行存储时,它就会得到这样一个结果。看看下面的情况: 看到否,在程序中DateTime默认情况之下是这个值{1/1/0001 12:00:00 阅读全文
posted @ 2016-12-11 18:13 Insus.NET 阅读(2329) 评论(0) 推荐(1) 编辑
摘要:昨晚把家里的电脑重新部署.NET开发环境。从晚上21点安装到今天凌晨3点多才完成,还算顺利,但是耗时最漫长莫过于在安装Visual Studio 2015 Update3...... 第一,全新安装Windows 10。 第二,安装.NET Framework 3.5和4.6。 第三,安装IIS。 阅读全文
posted @ 2016-10-27 10:40 Insus.NET 阅读(1730) 评论(0) 推荐(1) 编辑
摘要:Linq的delegate表达式,Insus.NET觉得它封装得好,让开发时简化了很多代码,而且容易阅读与检索。 比如,我们需要计算优惠给客户金额,打85%折,可以这样写: using System; using System.Collections.Generic; using System.Li 阅读全文
posted @ 2016-04-28 10:50 Insus.NET 阅读(1709) 评论(3) 推荐(1) 编辑
摘要:今天学习,如标题。创建一个类,字段属性构造函数:Source code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Task 阅读全文
posted @ 2016-04-27 14:07 Insus.NET 阅读(1196) 评论(3) 推荐(1) 编辑
摘要:很久没有写ASP.NET了,今天有看到论坛上一个问题:"两个dropDownList和一个GridView,已经进行了数据绑定,现在想让第一个下拉菜单的数据改变时,第二个下拉菜单自动变到相应的数据,同时选中gridview中相对应的行,不知道如何实现,很急,求大神相助"其实,实现起来算得上简单,下面 阅读全文
posted @ 2016-04-25 15:07 Insus.NET 阅读(1801) 评论(0) 推荐(4) 编辑
摘要:当你的数据库为SQLEXPRESS时,在程序的数据库连接字符串的服务Server使用127.0.0.1\SQLEXPRESS时,如下:它会显示一异常: Server Error in '/' Application. A network-related or instance-specific er 阅读全文
posted @ 2016-04-25 10:30 Insus.NET 阅读(1163) 评论(0) 推荐(1) 编辑
摘要:调试网站时,异常出现:Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. Server Error in '/' Application. Configuration Erro 阅读全文
posted @ 2016-04-24 19:04 Insus.NET 阅读(2252) 评论(0) 推荐(1) 编辑
摘要:Server Error in '/' Application. The system cannot find the file specified Description: An unhandled exception occurred during the execution of the cu 阅读全文
posted @ 2016-04-24 16:35 Insus.NET 阅读(4846) 评论(0) 推荐(1) 编辑
摘要:当你的ASP.NET MVC项跑在IIS时,出现如标题Handler "BlockViewHandler" has a bad module "ManagedPipelineHandler" in its module list异常时,可以尝试下面的解决方法,重新为IIS注册Framework。 6 阅读全文
posted @ 2016-04-24 15:19 Insus.NET 阅读(1285) 评论(0) 推荐(1) 编辑
摘要:自从在ASP.NET MVC中使用NuGet添加SignalR类库之后,再次运行程序时,它出现了一个异常: Server Error in '/' Application. The following errors occurred while attempting to load the app. 阅读全文
posted @ 2016-03-01 09:06 Insus.NET 阅读(4154) 评论(0) 推荐(2) 编辑
摘要:近段时间,需要写一个小功能,就是需要判断程序是否已经运行。某个程序安装后,也许被多个用户运行。那怎样判断当前用户已经运行了此程序了呢?下面是Insus.NET的做法,就是:《VB.NET WinForm获取运行程序用户名》http://www.cnblogs.com/insus/p/5194839. 阅读全文
posted @ 2016-02-19 15:07 Insus.NET 阅读(1462) 评论(0) 推荐(2) 编辑
摘要:运行Windows Task Manager,查看Users标签,可以看到所有登录电脑的用户,现在Insus.NET想命名用VB.NET的WinForm程序去获取当前的用户名. 获取程序简单,可以参考之: 源代码: Declare Function GetUserName Lib "advapi32 阅读全文
posted @ 2016-02-17 13:57 Insus.NET 阅读(2267) 评论(0) 推荐(1) 编辑
摘要:一个程序也许会被多个用户运行,如下:那在VB.NET的WinForm环境下,怎样获取User Name呢?可从下面的方法: 代码: Public Shared Function GetProcessOwner(ByVal ProcessName As String) As String Dim po 阅读全文
posted @ 2016-02-17 11:45 Insus.NET 阅读(1369) 评论(0) 推荐(2) 编辑
摘要:当你创建一个全新的ASP.NET MVC专案之后,你想设置统一的命名空间,从可以下面几次入手。首先设置专案的属性: 第二步,打开Views/Web.config文件,修改: 第三步,修改路由文件的命名空间: 第四步,修改Global.asax文件的命名空间: 以上的文档,均是创建专案时,默认产生的, 阅读全文
posted @ 2016-02-01 11:12 Insus.NET 阅读(1390) 评论(0) 推荐(4) 编辑

1 2 3 4 5 ··· 8 下一页