http://www.cnblogs.com/imfunny/archive/2011/08/11/2134639.html 因为许多的服务器特别是廉价的服务器上使用的是Framework的v2.0.50727。再加上自己开发的算是产品,所以就需要降低一些客户的前期成本,而自己同时也喜欢简单的代码。后来查了下,得知其实F
http://www.cnblogs.com/imfunny/archive/2011/08/11/2134639.html
因为许多的服务器特别是廉价的服务器上使用的是Framework的v2.0.50727。再加上自己开发的算是产品,所以就需要降低一些客户的前期成本,而自己同时也喜欢简单的代码。后来查了下,得知其实Framework3.5也是可以运行在2.0上的。引用System.Core.dll就可以直接的编写了。在2005下是不行的。因为2005默认的是2.0的编译器。即使引用了也没用。
引用后点击属性设置下。见截图啊。这样就可以在Vs2008上直接使用了。(这些都放到了附件里,需要的点击下载连接就行了。)
使用这个有什么好处呢。
首先就是方法的扩展了。
比如之前的MD5。
?
|
现在通过方法扩展可以写成这样
?
|
现在的代码越来越Query风格了。我喜欢。其实就不说了匿名函数,lamda表达式,linq了。
当完成这步的时候编译之后的Dll已经可以直接在2.0下运行了。
但是在WEB开发的时候。编译之后在2.0下可以运行的。总不能够每次修改都要把Dll给全部编译下。CodeFile在这样的情况下也是出错的。因为CodeFile在这个时候还是会出错的。默认的csc.exe是2.0的。这个时候就简单了。
把附件的包给解压出来,点击附件里的“取得权限.reg”,找到目录C:\Windows\Microsoft.NET\Framework\v2.0.50727,然后右键菜单上就有了“取得权限更改",点击它。然后把附件下v3.5.rar解压出来,把v3.5里的文件复制替换到v2.0.50727。于是编译器就更换了。然后点击“取得权限卸载.reg”。删除掉菜单里的取得权限的按钮。
有图有真相:
XP下应该同样。就不具体的去测试了。
OK。大工告成,现在一切都是浮云。剩下的就是去爽了。发布的时候生成DLL直接放到生产服务器上就行了。一切就那么简单啊。剩下的就是用3.5的风格去编写2.0的程序了。
那撒撒的,上面使用到的工具都整理了下,在附件里,想使用的直接点击附件下载吧。
附件下载

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

MySQloffersechar, Varchar, text, Anddenumforstringdata.usecharforfixed-Lengthstrings, VarcharerForvariable-Length, text forlarger text, AndenumforenforcingdataAntegritywithaetofvalues.

Optimizing MySQLBLOB requests can be done through the following strategies: 1. Reduce the frequency of BLOB query, use independent requests or delay loading; 2. Select the appropriate BLOB type (such as TINYBLOB); 3. Separate the BLOB data into separate tables; 4. Compress the BLOB data at the application layer; 5. Index the BLOB metadata. These methods can effectively improve performance by combining monitoring, caching and data sharding in actual applications.

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
