in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

Browse by Tags

All Tags » Win.Net » ASP.Net (RSS)
  • C# Interactive Shell and C# Eval

    http://tirania.org/blog/archive/2008/Sep-10.html 一个很有趣的项目。
    Posted Nov 14 2008, 09:56 PM by wicky with | with no comments
    Filed under: ,
  • Element Type of CLR

    et_unknown Undefined type. et_void ELEMENT_TYPE_VOID. et_boolean ELEMENT_TYPE_BOOLEAN, System.Boolean. et_char ELEMENT_TYPE_CHAR, System.Char. et_int8 ELEMENT_TYPE_I1, System.SByte. et_uint8 ELEMENT_TYPE_U1, System.Byte. et_int16 ELEMENT_TYPE_I2, System.Short. et_uint16 ELEMENT_TYPE_U2, System.UShort. et_int32 ELEMENT_TYPE_I4, System.Int. et_uint32 ELEMENT_TYPE_U4, System.UInt. et_int64 ELEMENT_TYPE_I8, System.Long. et_uint64 ELEMENT_TYPE_U8, System.ULong. et_float32 ELEMENT_TYPE_R4, System.Float...
    Posted Jun 28 2008, 10:21 AM by wicky with | with no comments
    Filed under: , ,
  • Creating great thumbnails in ASP.NET

    http://www.thebrainparasite.com/post/Creating-great-thumbnails-in-ASPNET.aspx Or refer to attached file.
    Posted May 27 2008, 02:21 PM by wicky with | with no comments
    Filed under: ,
  • How to make your Web Reference proxy URL dynamic

    A simple method, please refer to attached file.
    Posted Aug 30 2007, 10:20 PM by wicky with | with no comments
    Filed under: ,
  • ORA-02041: client database did not begin a transaction

    When using OracleClient connect to Oracle 8i and using database link, error "ORA-02041: client database did not begin a transaction" occur even for single select statement. This is unfortunately a known problem, there is a QFE ready which you can get by contacting PSS for Q830173, you also need to add a new keyword to the connection string, (please verify with PSS what the actual string is). As part of this workaround you cannot use Distributed Transactions on that particular connection...
    Posted Jun 07 2007, 08:09 PM by wicky with | with no comments
    Filed under: , ,
  • ActiveReports: Using Custom Paper Sizes

    http://www.datadynamics.com/forums/696/ShowPost.aspx The manner in which an ActiveReport is rendered is dictated by the print driver. If the printer you've explicitly assigned for the report (or the default printer for the machine it's being run on if none was assigned) does not support the paper size you've chosen, ActiveReports will render the report on the printer's default paper size. If you need your report to show on a custom paper size not supported by the printer, you can...
    Posted May 29 2007, 10:30 AM by wicky with | with 1 comment(s)
    Filed under: ,
  • UnicodeEncoding behavior in .Net 1.x and 2.0

    In .Net 1.x, we used to call UnicodeEncoding.GetString(byte[]) to convert byte array to string, and then call UnicodeEncoding.GetBytes(string) to convert it back to byte array. In .Net 2.0, this approach doesn't work anymore, it's because .Net 2.0 adds some checking to prevent invalid bytes from being converted to string. So after the roundtrip, you may lose something and cannot get the original bytes back. Here is a good post which discussed this issue and gave a suggestion: Don't Roundtrip...
    Posted May 25 2007, 08:29 AM by wicky with | with no comments
    Filed under: ,
  • Cut Image with C#

    Here is a sample which cut a png image to 16X16 bmp files: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 string path = @"e:\\Class.Browser16.png" ; Image large = Image.FromFile(path, true ); int x = 0; int y = 0; int width = 16; int height = 16; int count = large.Width / width; Bitmap bmp = new Bitmap(width, height); Graphics g = Graphics.FromImage(bmp); for ( int i = 0; i < count; i++ ) { g.Clear(Color.Transparent); g.DrawImage(large, new Rectangle(0, 0, width, height), new Rectangle...
    Posted May 21 2007, 05:45 PM by wicky with | with no comments
    Filed under: ,
  • Page.Cache, HttpContext.Cache, HttpRuntime.Cache的区别

    其实都是引用的同一样东西,通过Reflector可以看到,Page.Cache引用的是HttpContext.Cache,HttpContext.Cache引用的是HttpRuntime.Cache。前2的存在只是为了使用的方便而以。 由于Page和Context不是在任何环境都可用,HttpRuntime.Cache应该是最好的选择。 SimpleCache就是HttpRuntime.Cache的简单包装。 有种说法是HttpContext.Cache是页面相关的,由代码看,这个说法是错误的。 它们都指向同一个实例,范围是Application。
    Posted Feb 28 2007, 02:49 PM by wicky with | with no comments
    Filed under: ,
  • DataSourceUpdateMode in DataBinding

    有时我们希望在控件的值一修改就更新绑定的数据源。但是默认的DataBinding却不会这样做。 因为默认的DataSourceUpdateMode是OnValidation,一般也就是在离开焦点的时候才做这件事。 如果用DevExpress的XtraEditors,通常有几种方法: 1) call BaseEdit.DoValidate方法 2) call BindingContext[].EndCurrentEdit方法 3) 绑定的时候将DataSourceUpdateMode设置成OnPropertyChanged 例如: luePayTerms.DataBindings.Add("EditValue", dt, "PAYTERMS", false, DataSourceUpdateMode.OnPropertyChanged ); 某些情况下,由于MS Binding机制的关系,可能只有第3)种方法可用。 比如在LookupEdit的EditValueChanged事件里面就是这样的。
    Posted Feb 13 2007, 11:18 AM by wicky with | with 3 comment(s)
    Filed under: , ,
  • 如何得到硬盘序列号?.NET版本[C#]

    http://study.pay500.com/4/s44901.htm 硬盘序列号(Serial Number)不等于卷标号(Volume Name),后者虽然很容易得到,但是格式化分区后就会重写,不可靠。遗憾的是很多朋友往往分不清这一点。 要得到硬盘的物理序列号,可以通过WMI,也就是Win32_PhysicalMedia.SerialNumber。可惜的是Windows 98/ME的WMI并不支持这个类,访问时会出现异常。 受陆麟的例子的启发,我们还可以通过S.M.A.R.T.接口,直接从RING3调用API DeviceIoControl()来获取硬盘信息,而不需要写VXD或者DRIVER。这样这个问题就解决了,我对它进行了封装,大量使用了P/Invoke技术,一个完整的Library。支持Windows 98-2003。 使用上很简单: HardDiskInfo hdd = AtapiDevice.GetHddInfo(0); // 第一个硬盘 Console.WriteLine("Module Number: {0}", hdd.ModuleNumber); Console...
    Posted Feb 07 2007, 11:46 AM by wicky with | with no comments
    Filed under: , ,
  • Error: The constructor to deserialize an object of type 'XXX' was not found.

    You implement ISerializable interface. using System.Runtime.Serialization; [Serializable] class YourClassName { ... } You MUST wrote in your derived class this protected constructor for deserialization without any implementation. protected YourClassName(SerializationInfo info, StreamingContext context) :base(info,context){} Now you can serialize and deserialize your collection.
    Posted Nov 06 2006, 03:51 PM by wicky with | with no comments
    Filed under: , ,
  • C#编程:时间格式的转换

    http://dotnet.chinaitlab.com/CSharp/525282.html 有时候我们要对时间进行转换,达到不同的显示效果 默认格式为:2005-6-6 14:33:34 如果要换成成200506,06-2005,2005-6-6或更多的该怎么办呢 我们要用到:DateTime.ToString的方法(String, IFormatProvider) using System; using System.Globalization; String format="D"; DateTime date=DataTime,Now; Response.Write(date.ToString(format, DateTimeFormatInfo.InvariantInfo)); 结果输出 Thursday, June 16, 2005 参数format格式详细用法 格式字符 关联属性/说明 d ShortDatePattern D LongDatePattern f 完整日期和时间(长日期和短时间) F FullDateTimePattern(长日期和长时间) g 常规(短日期和短时间...
    Posted Sep 22 2006, 04:56 PM by wicky with | with 1 comment(s)
    Filed under: , ,
  • .Net执行带参数的Oracle命令产生的问题

    使用OracleClient,用Command执行带参数的Sql语句时,往往会产生古怪的问题,特别是参数是针对Varchar2类型的字段并且更新Unicode字符串的时候(如中文)。 如: ORA-01461: can bind a LONG value only for insert into a LONG column 如果根据错误信息,误以为设置DbType可以解决问题的话,可能会发生其他错误,如: ORA-12571: TNS:packet writer failure 甚至进程死掉。 这个问题由来已久,但是网上找不到很好的解决方案。 错误可能出现也可能不出现。比如在IDE下启动就OK,在IE里面启动就出错。 临时的解决方法是对Unicode字符串只有不用参数形式传递。
    Posted Aug 25 2006, 05:48 PM by wicky with | with no comments
    Filed under: ,
  • AssemblyName.GetAssemblyName

    这个方法可以获得打开某个Assembly文件,获得AssemblyName,随即释放。不会加载到当前的AppDomain。
    Posted Aug 02 2006, 01:48 PM by wicky with | with no comments
    Filed under: ,
  • 使用非默认的Oracle Client

    CDA需要使用Oracle 10g Client,而同一台机器上的其他程序暂时都是使用Oracle 8i Client,默认Client是Oracle 8.1.7。如何是好呢? 一个简单的解决方案: Web.config: <appSettings> <add key="oracleClientPath" value="c:\oracle\ora10g\bin" /> </appSettings> Global.asax: void Application_Start( object sender, EventArgs e) { Application.Lock(); ... string oracle = Config.OracleClientPath; if (!String.IsNullOrEmpty(oracle)) { string path = Environment.GetEnvironmentVariable( "path" ); path = String.Format( "{0}{1}{2}" , oracle, (oracle[oracle...
    Posted Jun 28 2006, 04:59 PM by wicky with | with no comments
    Filed under: , ,
  • C#中的Nullable Type和??操作符

    The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand. 以前我们会这么写: string param = Request.Params[ "param" ]; if ( param == null ) { param = defaultValue; } 或 string param = Request.Params[ "param" ] == null ? defaultValue : Request.Params[ "param" ]; 现在这么写就可以了: string params = Reqeust.Params[ "param" ] ?? defaultValue; 够简单了吧。 定义Nullable Type: int? a = null; int b = 1; int c = a??0 + b;
    Posted Jun 14 2006, 10:47 PM by wicky with | with 1 comment(s)
    Filed under: , ,
  • ActiveReports : How to Remove the Evaluation Banner Once a License is Purchased

    If you are seeing the evaluation banner, but have purchased a license for the product, this article will take you step by step through trouble shooting the problem. Have you run the licensing executable on your machine? There is a licensing executable which is distributed with the product (License.exe, LicensePro.exe, LicenseStd2.exe, or LicensePro2.exe). When this executable is run you will be prompted for your name, company name, and serial number. You can verify that the machine has been properly...
Copyright SDT, 2006-2009. All rights reserved.