
DotNET
xeonol
这个作者很懒,什么都没留下…
展开
-
Dynamic Script for executing in VB.NET
VB.NET中执行动态代码的例子 以下function传入一个逻辑表达式,使用动态代码编译并返回逻辑结果 Shared objCodeCompiler As ICodeCompiler = New VBCodeProvider().CreateCompiler() Shared objCompilerParameters As New CompilerParameter原创 2006-03-08 18:19:00 · 912 阅读 · 0 评论 -
用WPF做的一个坐标轴
Grid> Grid.Resources> MeshGeometry3D x:Key="axisMesh" Positions="0,0.3,0 0,0.3,10 0,0.6,10 0.0927050983124842,0.285316954888546,0 0.0927050983124842,0.2原创 2007-12-09 22:11:00 · 5900 阅读 · 1 评论 -
VBCode in C# runtime compiling
using System;using System.CodeDom.Compiler; using Microsoft.VisualBasic;using System.Reflection;using System.Text;public class FuncXYCodeDomHelper{ Assembly assy; object execInstance; MethodInf原创 2007-12-09 23:29:00 · 847 阅读 · 0 评论 -
用WPF 做了一个简单的太阳系
这次主要的目的是为了学习它的3d动画方法,只用了xaml,没有写代码。先是上网查了查行星数据,做了8个大行星和一个月亮在里面,不过发现如果真的按实际比例画的话,太不容易观看了,就比如太阳半径 是地球的109倍,距离更大,近25000倍,在图上会除了太阳其他都像像素点那么小,于是只好把距离按10Mkm作为一个单位,而画行星的半径按地球半径6378km作为一个单位,然后忽略太阳大小,直接设为1原创 2007-12-11 00:59:00 · 1875 阅读 · 1 评论 -
Point3DCollectionAnimation中的collection.Clear问题
模仿Charles Petzold的PointCollectionAnimation写了一个Point3DCollectionAnimation,自己按照理解的写了using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using Syste原创 2007-12-12 11:32:00 · 1261 阅读 · 0 评论 -
BilinearGradientBrushExtension, custom brush in WPF using MarkupExtension instead
WPF的类库现在锁死不让继承实现自定义的Brush,因为基类的brush含有抽象而且是internal的一些函数,像internal abstract System.Windows.Media.Composition.DUCE.ResourceHandle AddRefOnChannelCore(System.Windows.Media.Composition.DUCE.Channel chann原创 2007-12-17 09:45:00 · 2055 阅读 · 1 评论 -
Parameter stride in WritableBitmap.WritePixels
The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory. 之前还以为WritePixels(Int32Rect sourceRect, Array pixels, int stride, int offset)中的stride是传进去数组pi原创 2007-12-17 10:15:00 · 1590 阅读 · 0 评论 -
.NET Licensing
最近因为需要测试LC,所以研究了一下Windows类和一般控件的Licensing。网上有一篇很好的入门文章: http://windowsclient.net/articles/Licensing.aspx ,我这篇主要知识都来自它,这里只是简要记录一下免得以后忘掉。就以类的Licensing来说,关键点在于文章所说 The LicenseProviderAttribute原创 2008-07-08 16:09:00 · 814 阅读 · 0 评论 -
Software Wars
很cool的一张图。来自http://mshiltonj.com/software_wars/current/转载 2008-07-08 17:03:00 · 726 阅读 · 0 评论 -
OutputDebugString
To put string in VSs debug output window: Managed:System.Diagnostics.Debug.WriteLine("I am using dot net debugging"); Native C++:#include int _tmain(int argc, _TCHAR* argv[]){原创 2009-06-11 15:13:00 · 607 阅读 · 0 评论 -
自行控制GridView的Paging和Sorting
private string ConvertSortDirectionToSql(SortDirection sortDirection){ string newSortDirection = String.Empty; switch (sortDirection) { case SortDirection.Ascending:转载 2010-04-20 21:51:00 · 1341 阅读 · 0 评论 -
使用ASP.NET的权限系统
1. 生成aspnet的权限数据表和sp,使用.net 2.0的命令如下:C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>aspnet_regsql -W使用-W参数调出连接数据库向导,根据向导生成数据库数据。 2. 在web.config更改验证方式并添加providers " />原创 2010-04-20 23:28:00 · 3138 阅读 · 2 评论 -
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps
<br /> <br />原文来自http://odetocode.com/code/450.aspx, 挺不错的文章,让我了解了Master Pages内部实现机制和一些应用技巧。<br /><br />Master pages are a great addition to the ASP.NET 2.0 feature set. Master pages help us build consistent and maintainable user interfaces. Master pages转载 2010-07-08 13:28:00 · 2134 阅读 · 0 评论 -
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps
<br /> <br />原文来自http://odetocode.com/code/450.aspx, 挺不错的文章,让我了解了Master Pages内部实现机制和一些应用技巧。<br /><br />Master pages are a great addition to the ASP.NET 2.0 feature set. Master pages help us build consistent and maintainable user interfaces. Master pages转载 2010-07-08 13:29:00 · 1908 阅读 · 0 评论 -
strong name in .NET
强名称能够提供一个唯一标志符,因此带有强名称的assembly就像数字签名的邮件一样,使用assembly的用户端可以根据这个标志来设定读取/使用它的权限。另一个强名称的功能是为assembly做版本化,用于避免dll hell。原创 2006-05-12 15:47:00 · 1207 阅读 · 0 评论 -
OCI-22053: overflow error
在.NET中连接oracle,使用dataadapter fill的时候出现OCI-22053: overflow error的异常,因为.NET的数据类型精度比oracle的类型精度小,类如select sysdate-issuetime as timediff from sometable中返回的精度过大,改为select trunc(sysdate-issuetime,2) as t原创 2006-05-12 15:38:00 · 4192 阅读 · 0 评论 -
TraceLog in VB.NET
Tracing with .NETThe .NET Framework includes classes and data types that make it easy to log trace messages—the logging infrastructure is right there for you. Figure 1 lists the .NET Framework classes转载 2006-03-11 14:13:00 · 1125 阅读 · 0 评论 -
Scroller in datagrid
1. 把 DataGrig 包在 Div 裡面 2. 設定固定 header 的 style.DataGridFixedHeader {background-color: white; position:relative; top:expression(this.offsetParent.scrollTop);}-->3. 把這個 style 設給 HeaderStyle 的原创 2006-03-29 13:11:00 · 754 阅读 · 0 评论 -
Get threadid in dotnet
sThreadID = AppDomain.GetCurrentThreadId()原创 2006-03-29 16:29:00 · 817 阅读 · 0 评论 -
Windows Service Assembly必须增加的内容
The main entry point for the process _ Shared Sub Main() Dim ServicesToRun() As System.ServiceProcess.ServiceBase More than one NT Service may run within the same proces原创 2006-03-29 17:40:00 · 942 阅读 · 0 评论 -
Calculate elapsed time in VB.NET
DotNET里面使用Timer获取精确时间计数值,可以用于程序执行时间的计算http://support.microsoft.com/default.aspx?scid=kb;en-us;111268Sub ElapsedTime() Dim StartTime As Double, EndTime As Double Stores start time in variabl原创 2006-03-08 18:16:00 · 959 阅读 · 0 评论 -
Uninstall Windows Service注意的事项
使用installutil /u serviceassembly,再次安装时抱错Running a transacted installation.Beginning the Install phase of the installation.See the contents of the log file for the .../obj/release/ncsscanner.exe原创 2006-03-29 17:24:00 · 2922 阅读 · 0 评论 -
使用WebClient
Public Shared Function GetUrlContent(ByVal url As String) As String Try Dim myClient As WebClient = New WebClient Return Text.Encoding.UTF8.GetString(myClient.Download原创 2006-03-31 09:40:00 · 893 阅读 · 0 评论 -
asp.net不能用于做长时间的服务进程?
在做一个使用WebService的项目,中间有一个模块需要不停的扫描数据库并进行处理,开始就把这一部分用写在线程类写在http application里了,但似乎application在一段时间没有request情况下会自动关闭。看来对asp.net里的进程还需要再看一些文章。。。原创 2006-03-29 13:37:00 · 848 阅读 · 0 评论 -
DotNet Type to SqlDbType?
使用reflection机制操作类的持久化,在ADO.NET的IDataParameter设定Type时需要把dotnet的类型转化为dbtype,google了一下,似乎没什么偷懒的方法,得到的建议都是使用switch结构,麻烦。好在大部分成员变量都是string类型,直接建立parameter会对应到nvarchar,但是datetime类型会有些麻烦,因为dotnet的datetime类型值原创 2006-04-05 18:55:00 · 1274 阅读 · 1 评论 -
Control.CheckForIllegalCrossThreadCalls
使用了FormDrag后,发现在SharpDevelop下会出现exception:"System.InvalidOperationException: Cross-thread operation not valid: Control [your_control_name_here] accessed from a thread other than the thread it was cr原创 2006-04-12 15:46:00 · 3679 阅读 · 1 评论 -
request for the permission of type system.net.webpermission ....... is failed
运行一只调用web service 的程序,出现权限异常:request for the permission of type system.net.webpermission查找出来的结果,发现是UNC路径下运行程序的问题,把程序从网络文件夹上拷到本地硬盘上就没问题了原创 2006-04-12 16:36:00 · 3076 阅读 · 0 评论 -
String.Format
搜到的一个方案,应该可以应用于建立适用于多种数据库的数据访问操作语句里面。对应于Oracle ,binding variable的写法是select * from usertbl where id=:id,而sql server是select * from usertbl where id=@id。private const string SQL_GET_RECORD = "SELECT原创 2006-04-12 22:22:00 · 994 阅读 · 0 评论 -
Stream to String
protected static System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(HotKeyMessage)); public string toXML() { System.IO.StringWriter sw = new System.I原创 2006-04-27 13:56:00 · 1228 阅读 · 0 评论