Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

wmic:Windows Management Instrumentation Command-line(Windows管理规范命令行)
开始-运行-wmic :
进程:
process
查看指定 process where name=”editor.exe”
服务:
service get caption,pathname


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

最具体的功能到底需要哪些,需要做到多细,都要由哪些详细的功能也都没了解,最终有多少个工作量?有没有参考例子
这个功能倒是那个部门用?有几个人用?都有谁谁来用?真的是单机版就可以了吗?
新项目如何正式上线?老数据如何倒入,什么时候导入?新系统如何测试?2个系统如何平滑衔接?
有没有签订正规的合同


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

http://localhost/phnix2/confirm.html?1=1&CustomerName=%ba%c3%b5%c4&tel=4444444&phone=33333333&mail=333333&CustomerAddress=%bc%d2%cd%a5%c8%cb&Remark=%bc%d2%cd%a5%c8%cb&CustomerId=51
URL传到前台后,前台js利用unescapte等方法均得不到中文。

解决方法:
后台:项目添加引用 Microsoft.Jscript
利用Microsoft.JScript.GlobalObject.escape(URL); 进行编码
前台利用unescape解码


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
DataSource对下列数据源有效

    * DataTable
    * DataView
    * DataSet
    * DataViewManager
    * 任何实现 IListSource 接口的组件 
    * 任何实现 IList 接口的组件:可利用此特性进行每条记录数据的对象封装

如: list.Add(new Product {id = 1, name = "Melon", price = 12});
        list.Add(new Product {id = 2,name = "Pear", price = 13});
        list.Add(new Product {id = 3,name = "Milk", price = 14});
        list.Add(new Product {id = 4,name = "Coca Cola", price = 15});
        list.Add(new Product {id = 5,name = "Pepsi Cola", price = 16});
        gv.DataSource = list;
        gv.DataBind();


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

IE – 选项 – 常规-设置-检查所存网页的较新版本 – 每次访问此页时检查(E)
Firefox 下的设置方法:
1.在firefox的地址栏上输入about:config回车
2.找到browser.cache.check_doc_frequency选项,双击将3改成1保存即可。
0: 每个进程一次 每次启动Firefox时检查
1: 每次访问此页时检查
2: Never 不检查
3: 自动


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,连接数据库:
var configuration = new Configuration();
configuration.Configure(); //自动探索hibernate.cfg.xml或web.config中的nhibernate
configuration.AddAssembly(typeof(Product).Assembly); //指定加载哪个程序集,若不写,则默认加载工程本身
2, 连接完数据库后创建Session: _sessionFactory = configuration.BuildSessionFactory(); SessionFactory.OpenSession();
3,利用Session完之后,因是延迟加载,需用 _Session.Flush(); 提交更新,或者待Session销毁时自动提交,如:
using (ISession session = NHibernateHelper.OpenSession())
{
session.Save(user);
}


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
下载:nhibernate

使用方式:
1,项目引入dll:

    * Antlr3.Runtime.dll
    * Castle.Core.dll
    * Iesi.Collections.dll
    * LinFu.DynamicProxy.dll
    * log4net.dll
    * NHibernate.ByteCode.Castle.dll
    * NHibernate.ByteCode.LinFu.dll
    * NHibernate.dll
    * nunit.core.dll
    * nunit.framework.dll

2,编写数据库连接:对于一般的应用程序,编写hibernate.cfg.xml放在根目录下,属性设置为始终复制,因为nhibernate是对输出目录bin的文件进行读取的,对于web可在web.config中进行添加。
      1)hibernate.cfg.xml,在官方文档的Configuration_Templates文件夹下有模板,例子如下:
       



  
    NHibernate.Driver.SqlClientDriver
    
      Server=(local);initial catalog=nhibernate;Integrated Security=SSPI;user id=sa;password=123abc;min pool size=1;max pool size=512
    
    10
    false
    NHibernate.Dialect.MsSql2000Dialect
    true
    60
    true 1, false 0, yes 'Y', no 'N'
    NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu
  

 
     2) web.config 在下进行Nhibernate 配置

            
3,编写实体类 4,编写实体类映射文件 如:Product.hbm.xml,将此其属性设置为嵌入资源,这是因为NHibernate是通过查找程序集中的资源文件来进行实体的映射,故要将映射文件嵌入到程序集中。 如: 注:1), 要为Microsoft Visual Studio 2008添加编写NHibernate配置文件智能提示的功能。只要在下载的NHibernate里找到configuration.xsd和 nhibernate-mapping.xsd两个文件并复制到X:\Program Files\Microsoft Visual Studio 9.0\Xml\Schemas目录即可。 2),此时即可通过架构类来自动生成数据库表 var cfg = new Configuration(); cfg.Configure(); cfg.AddAssembly(typeof(Product).Assembly); new SchemaExport(cfg).Execute(true, true, false); 5,因为操作数据库是用Session来完成的,可编写一helper类,用来集中处理, 编写NHibernateHelper.cs如下: using NHibernate; using NHibernate.Cfg; using NHebernateTest.Domain; namespace NHebernateTest.Repositories { public class NHibernateHelper { private static ISessionFactory _sessionFactory; private static ISessionFactory SessionFactory { get { if (_sessionFactory == null) { var configuration = new Configuration(); configuration.Configure(); //configuration.AddAssembly(typeof(Product).Assembly); _sessionFactory = configuration.BuildSessionFactory(); } return _sessionFactory; } } public static ISession OpenSession() { return SessionFactory.OpenSession(); } } } 6,编写操作类及接口,操作类即是引用上面的helper类进行数据库的操作。 1)CRUD操作: using (ISession session = NHibernateHelper.OpenSession()) using (ITransaction transaction = session.BeginTransaction()) { session.Update(product); //session.Save(product);session.Delete(product); transaction.Commit(); } 2)查询 * 据关键字查询:session.Get(productId); * 据其它属性查询 * 返回一个值:session.CreateCriteria(typeof(Product)).Add(Restrictions.Eq("Name", name)).UniqueResult(); * 返回一个集合:session.CreateCriteria(typeof(Product)).Add(Restrictions.Eq("Name", name)).List();


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

因为id是唯一的,而name可以重复,故对于多个radio而言可用一个name表示,然后Request直接通过此name获取值。


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
	先编写持久化类和映射文件,然后使用SchemaExport工具生成数据库架构。这样的方式就是领域驱动设计/开发。
好处:当领域模型需要改变,只需修改NHibernate结构和应用程序,不需要修改数据库架构,只要利用SchemaExport工具重新生成数据库架构就可以了。但是使用数据库只是其中一种方式,我们也可以使用XML文件来存储数据。

	NHibernate的hbm2dll提供SchemaExport工具:给定一个连接字符串和映射文件,不需输入其他东西就可以按照持久化类和映射文件自动生成数据库架构
SchemaExport工具就是把DDL脚本输出到标准输出,同时/或者执行DDL语句。SchemaExport工具提供了三个方法,分别是 Drop()、Create()、Execute(),前两个方法实质是调用Execute()方法。通常使用Execute()方法来生成数据库架构的。

如:      
	var cfg = new Configuration();

	cfg.Configure(); //自动寻找hibernate.cfg.xml文件读取数据库连接信息

	cfg.AddAssembly(typeof(Product).Assembly); //根据Product类查找Product.hbm.xml

	new SchemaExport(cfg).Execute(true, true, false);
	//第一个true输出sql创建语句到控制台,第二个用来先删除后创建


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,商务通存数据,一种方式是存放到数据库中,客户的录入的信息存放数据库,然后客服端定时读取。这种的频繁对数据库的读写,且数据在磁盘上,速度、效率很有影响。另一种方式是在内存中设置一共享区如建立一static List集合,客户端向里面存,客服取,共同维护这一共享区,然后定时将此共享区的内容存入数据库即可。
至于客服端与服务器进行静态类共享的问题(即客服端与服务器共享服务器内存),可以利用web service来解决。在客户端点应用程序中添加服务器端的webservice,会自动引用服务器的命名空间,然后直接使用类即可。因为此类指定静态的,故做到了共享。 可参见PowerTalk的聊天信息存读方式。

即共享区用:static + webservice构造,static负责共享,webservice负责同一

Web Service本身其实是在实现应用程序间的通信。
客户端的概念是调用服务器上的远程过程,通常方式为实例化一个远程对象并调用其方法和属性。:服务器暴露出远程对象的接口,客户端就好像在本地使用的这些对象的接口一样,这样就隐藏了底层的信息,客户端也就根本不需要知道对象是在哪台机器上。

2, 将数据存放到内存中定时转储的方式属于NOSQL,代表之一Redis
Redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)和zset(有序集合)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的。在此基础上,redis支持各种不同方式的排序。与memcached一样,为了保证效率,数据都是缓存在内存中。区别的是redis会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记录文件,并且在此基础上实现了master-slave(主从)同步。


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

comm100
注册一个编号,可以新建多个客服。支持文本和语音聊天,客服转接和加入对话 ,监控访客动态,主动抓住客户等。还开以开论坛、知识库,关键是开源,免费的。
效果如下:
客户界面(可定制):
客户界面

信息来时提醒:
信息来时的提醒界面

客服界面:
客服界面


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,添加引用:DropDownCheckList.dll
2,将DropDownCheckList.js放置到网站根目录的aspnet_client\UNLV_IAP_WebControls\DropDownCheckList\文件夹下
3,演示代码
4,获取选择的数据:
Label1.Text = this.DropDownCheckList1.SelectedValuesToString(“,”, “”);
//Label2.Text = this.DropDownCheckList1.SelectedLabelsToString(“,”,””);

效果图:
多选下拉框
引用:http://www.codeproject.com/KB/custom-controls/DropDownCheckList.aspx#xx2456914xx


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

案例:任务管理器中结束一进程,很快就自动出现。解决方法是找到此进程所在的文件进行删除。还有一dll文件删除不掉是因为有exe文件在运行,找到此exe文件进行删除即可。

在界面操作时,去掉√不启作用,正确方法是在cmd下操作:

attrib -s -h -r Client_Files

Attrib
显示、设置或删除指派给文件或目录的只读、存档、系统以及隐藏属性。如果在不含参数的情况下使用,则 attrib 命令会显示当前目录中所有文件的属性。
语法
attrib [{+r | -r}] [{+a | -a}] [{+s | -s}] [{+h | -h}]
attrib [[Drive:][Path] FileName] [/s[/d]]
参数
+r
设置只读文件属性。
-r
清除只读文件属性。
+a
设置存档属性。
-a
清除存档属性。
+s
设置系统文件属性。
-s
清除系统文件属性。
+h
设置隐藏文件属性。
-h
清除隐藏文件属性。
[Drive:][Path] FileName
指定要显示或更改其属性的目录、文件或文件组的位置和名称。可以在 filename 参数中使用通配符(? 和 *)来显示或更改一组文件的属性。
/s
将 attrib 和任意命令行选项应用到当前目录及其所有子目录中的匹配文件。
/d
将 attrib 和任意命令行选项应用到目录。
/?


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,选择语句:

* 每句后加分号;
* else if 应为elseif,中间不留空格。mssql为:if begin … end else if begin … end 形式

IF ( _TranType=’Insert’ ) THEN
INSERT INTO bmdcustomer(CustomerName,CustomerAddress,tel,Remark,Type,LastEditBy,LastEditDate)
VALUES(_CustomerName,_CustomerAddress,_tel,_Remark,_Type,_LastEditBy,now());
SET _Id = @@IDENTITY;

ELSEIF ( _TranType=’Update’ ) THEN
INSERT INTO bmdcustomer(CustomerName,CustomerAddress,tel,Remark,Type,LastEditBy,LastEditDate)
VALUES(_CustomerName,_CustomerAddress,_tel,_Remark,_Type,_LastEditBy,now());
SET _Id = @@IDENTITY;
ELSE
SELECT 1;
END IF;

2,日期:当前时间,Mysql: now(), MsSql:getdate()


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
1,将循环因子1,2,3,4,5....存入一表中,用此表与目标表进行关联即可。
2,例子:提取 字符串  ‘13604784785薛小姐’非中文部分
create table #tt(n int)          --循环数
declare @tt int
set @tt=1
while @tt<=200
begin
        insert #tt values(@tt)
        set @tt=@tt+1
END
CREATE TABLE #ts(tel VARCHAR(100))
INSERT INTO #ts VALUES ('13604784785薛小姐')

declare @string varchar(200)
SELECT TOP 1 *,SUBSTRING(tel,1,n-1) FROM (
SELECT tel,n,case when SUBSTRING(tel,n,1) LIKE '[0-9]' THEN NULL ELSE STUFF(tel,n,0,'#') END AS 'string'
FROM #ts JOIN #tt ON n < LEN(#ts.tel))m1
WHERE m1.string IS NOT null


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

一般用法为:
select case 1 when 1 then ‘yes’ when 2 then ‘no’ end
即为:when 1=1 取 ‘yes’
when 1=2 取 ‘no’
多条件为:
SELECT CASE WHEN 1=2 THEN 2 when 3=3 then 3 ELSE 4 end
case后不带参数,when可作多个条件

带语句使用:
–若是一次部门,输出第一次下订单日期,若是二次部门等,输出第一次分配客户日期
SELECT md.DepartName,a.UserName,CASE(md.DepartType)
WHEN ‘first’
THEN (SELECT MIN(orderdate) FROM bdOrder bo WHERE bo.SalesStaff=a.Account )
ELSE (SELECT MIN(opendate) FROM bdCustomerAllocate bca WHERE bca.SalesStaff =a.Account ) END
FROM frmuser a(NOLOCK)
JOIN mdDepartment md ON a.DepartmentId = md.ID
注: THEN 后面是一个值,故SELECT要用括号括起来。


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

对于Windows程序 和Web 应用程序来说,他们运行的路径是不一样的,所以关键是判断当前运行的程序是哪种程序.于是可以使用如下的代码 string path = ""; if (System.Environment.CurrentDirectory == AppDomain.CurrentDomain.BaseDirectory)//Windows应用程序则相等 …{ path = AppDomain.CurrentDomain.BaseDirectory; } else …{ path = AppDomain.CurrentDomain.BaseDirectory + "Bin\"; }

HttpContext.Current.Request.Url.AbsoluteUri

        //获取网站根目录
        public static string GetRootURI()
        {
            string AppPath = "";
            HttpContext HttpCurrent = HttpContext.Current;
            HttpRequest Req;
            if (HttpCurrent != null)
            {
                Req = HttpCurrent.Request;

                string UrlAuthority = Req.Url.GetLeftPart(UriPartial.Authority);
                if (Req.ApplicationPath == null || Req.ApplicationPath == "/")
                    //直接安装在   Web   站点  
                    AppPath = UrlAuthority;
                else
                    //安装在虚拟子目录下  
                    AppPath = UrlAuthority + Req.ApplicationPath;
            }
            return AppPath;
        }


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

关键点是将不变化的东西固定下来,避免重复计算。设计表时,将不依赖外部数据,可直接得出的部分提取出来,方便查询。

有一快递A,快递价格递增,价格表如下:
重量(kg) 费用(元)
0-1 6
1-5 3/kg
5-10 2/kg
10-9999 1/kg
同时有一快递B,直接按公斤给价格,价格表如下:
0-1 6
1-5 16
5-10 24
10-9999 30
设计一table,将两种的价格表录入系统,并给出查询物品重量为n时的快递价格。

思路:快递A价格递增,计算时要考虑他之前物重范围相加。而B就相对简单,直接select取出。而价格表存放到同一表中,就要考虑容纳上面的两种特性。设计表如下:
快递公司 重量下限 重量上限 费用 子范围费用 (注:用附加费用存储比它小的范围的数据)
表数据存储为:
快递公司 重量下限 重量上限 费用 子范围费用
A 0 1 6 0
A 1 5 3 6 (直接给出前一范围的价格)
A 5 10 2 18
A 10 9999 1 28
B 0 1 6 0
B 1 5 16 0
B 5 10 24 0
B 10 9999 30 0

当外部传入快递公司为@X,物重为@weight时求其快递价格,可用如下方式:
SELECT CASE(附加费用) WHEN 0 THEN 费用 ELSE 子范围费用 + (n – 重量下限) * 费用
FROM 快递费用表
WHERE 快递公司 = @X
AND @weight BETWEEN 重量下限 AND 重量上限


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

72法则
假设以年利率r%投资一笔钱y年,如果r*y=72,那么你的投资差不多会翻倍。
即:增长率乘以增长次数若为72,那么数字翻倍。
原理:(1+ x)的y次方 = 2
y= ln2 / ln(1+x) ; ln2 = 0.69, ln(1+x) = x (泰勒公式),
故有:y= 0.69/x 即:xy = 0.69 , 0.69不易估算,换成70,72。之所以选用72,是因为它有较多因数,容易被整除,更方便计算。它的因数有1、2、3、4、6、8、9、12和它本身。

具体例子:

以年利率6%投资1000美元12年,可得到约2000美元(实际数字是2012美元)

以年利率8%投资1000美元9年,可得到约2000美元(实际数字式1999美元)

假设一个指数程序解决规模为n=40的问题需要10秒的时间,并且n每增加1运行时间就增加12%,问当我们把n=100的时候,大约需要多少运行时间?

根据72法则,n每增加6运行时间翻倍,那么当n增加60,运行时间增加为原来的2^10≈1000倍。因此,n=100时,大约需要10 000秒(2~3个小时)。

联合国估算1998年的世界人口为59亿,年增长率为1.33%。如果按照这个速率下去,到2050年人口会是多少?

2050-1998=52; 52*1.33≈70

因此根据72法则,2050年人口约为59*2=118亿。

出处:(http://www.cnblogs.com/yjf512/)