
C#
shanechan517
这个作者很懒,什么都没留下…
展开
-
Property in C#
While learning C#, the Property confused me a lot, as it is very similar to the member variable in class.there are must some reasons for its existence, otherwise it will simply replaced by the memb原创 2012-05-15 22:13:10 · 367 阅读 · 0 评论 -
Linq to SQL 文件上传到服务器后未实例化问题
Got a weird issue today with a LINQ to SQL dbml file.It did work all right in local host but collapse after uploading to the web server.It threw an Object reference not set to an instance of a原创 2013-09-25 08:41:00 · 596 阅读 · 0 评论 -
VS2010 hotkey
1. FormatCtrl + K + D (Entire document)Ctrl + K + F (Selection only)orCtrl+E, Ctrl+D to format the entire document.Ctrl+E, Ctrl+F to format the selection.转载 2013-07-01 08:49:17 · 476 阅读 · 0 评论 -
Reference for SendMail in ASP.NET
using System.Net;using System.Net.Mail;using (MailMessage message = new MailMessage()){ message.To.Add(new MailAddress("supremezone@126.com")); //收件人邮箱 message.Subject = "通过配置文件设转载 2013-04-09 09:37:06 · 558 阅读 · 0 评论 -
regular expression for formating name
static string CapText(Match m){ // Get the matched string. string x = m.ToString(); // If the first char is lower case... if (char.IsLower(x[0])) {原创 2012-11-29 13:00:40 · 302 阅读 · 0 评论 -
.net 让textbox readonly的办法
给控件添加属性:onfocus=this.blur()转载 2012-11-27 07:44:47 · 316 阅读 · 0 评论 -
将asp文件上传到server后遇到'Could not load type'的错误原因
刚接触asp.net的人,在把文件上传到server后可能会遇到 ‘Could not load type’ 的错误aspx页面中如果把页面顶部的Inherits属性删除也能临时解决这个问题实际上这个错误是因为没有上传bin文件夹及其内容到服务器造成的在编译项目时,vs会把文件按照namespace编译成dll文件,页面载入时需要用到这些文件所以再上传项目时要把项目编译好,然后把b原创 2012-08-30 13:52:12 · 1365 阅读 · 0 评论 -
aspnetpager实例
前台:<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>原创 2012-08-01 14:31:12 · 775 阅读 · 0 评论 -
allowDefinition='MachineToApplication' error solution
The error "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an原创 2012-06-07 12:14:34 · 555 阅读 · 0 评论 -
LINQ study notes
LINQ study notes1. LINQ concept:LINQ stands for language integrated Query. You can retrieval datafrom various sources (SQL database, list, object, xml, array) by just using LINQ,instead of differe原创 2012-05-15 22:14:20 · 329 阅读 · 0 评论 -
linq中的Single()、First()、Take(1) 区别
Single():操作一个集合,同时强要求只有一个对象匹配,并返回这一个。First():操作一个集合,可以有多个对象匹配,但是只返回第一个。Take(1):操作一个集合,可以有对个对象匹配,单只返回第一个,但是这里返回的是一个集合,而不是单个的概念。转载 2012-05-18 14:23:00 · 2319 阅读 · 0 评论 -
Example of Sending email with attachments in C#
//file pathstring file_ddr_service_agreement = HttpContext.Current.Server.MapPath(@"~\service_solutions\freedom_to_learn\FTL_online\myorder\schoolpages\Direct_Debit_Agreement-2013\") + "Comput原创 2013-10-16 13:37:26 · 863 阅读 · 0 评论