.net miner

something about life, me and .net
  • Home
  • Categories
    • C#
    • .Net
    • Tools
    • General
    • Visual Studio
    • Open Source Projects
  • Contact Me
.Net•C#•Tools•Visual Studio

Extending PropertyGrid Adding custom PropertyTab and PropertyDescritors

24 August 2008 by Ozcan Degirmenci No Comments
Extending PropertyGrid Adding custom PropertyTab and PropertyDescritors

An example screenshot of the Custom Property Grid Tab

Most of the programmers who uses Visual Studio .NET knows PropertyGrid which is the main control in the Properties Window of the Visual Studio.

Continue reading
Share:
Reading time: 1 min
.Net•C#•Visual Studio

How To Make Multilanguage Supported Category And Description Attributes

21 August 2008 by Ozcan Degirmenci No Comments

If you have written any .NET components you must be familiar with Category and Description attributes. We use Category attribute to identify the property’s category and Description attribute is for the short description of that property. But because of the nature of Attributes in .NET we cannot pass any parameter to these attributes for Multilanguage support.

[Category(Properties.Resources.MyCategory)]
[Description(Properties.Resources.MyDescription)]
public int MyProperty { … }

This kind of usage is not allowed for .NET, because we are only allowed to give constant values to the attributes constructor.  So how can we use these attributes as Multilanguage?

Continue reading
Share:
Reading time: 1 min
.Net•C#•General•Tools•Visual Studio

How To Create TFS WorkItems Programmatically

by Ozcan Degirmenci No Comments

If you are using Team Foundation Server with Visual Studio, it will be useful for you to integrate your projects bug system with the TFS Work Items system. You can write a simple module for your program which will handles the exceptions and collects needed information and send them to the TFS.

So how can we do something like that? First you have to write an error management module which will handles exceptions, errors, etc. and generates understandable information from them. After generating this information lastly you have to send this information to the TFS.

Continue reading

Share:
Reading time: 3 min
.Net•General•Tools

How To Protect An Assembly From Decompiling

5 June 2008 by Ozcan Degirmenci No Comments

When I was newbie in .NET, it was a shocked for me to learn that .NET assemblies can be decompile. But today I know that this is a normal situation for a language which is compiling to an intermediate language. As we know that, after compiling a .NET project the output will be in MSIL (Microsoft Intermediate Language). And during the application lifecycle this codes will be compiled to Native Codes by the JIT (Just-In-Time Compiler) when they first used and cached in that computer for the future usages. Anyway this is another subject for us how JIT works, but here the problem is our assemblies are in MSIL format which has about 229 opcodes and all these opcodes has a standard working procedure. So if we know these opcodes and how they are working, we can produce the .NET codes by reverse engineering. This is simply what decompilers do. But why there are no stable decompilers for the native exes?

Continue reading

Share:
Reading time: 4 min
.Net•C#

Switch vs If

16 May 2008 by Ozcan Degirmenci No Comments
Switch vs IF

An example screenshot of the Switch ve IF

Most of the people know that switch works like if-else blocks. The only difference between the switch and if-else is its being for the many conditional states, and also writing switch is more simple than if-else block. This knowledge is really a big   mistake  because switch has a different algorithm and working-procedure comparing to if-else block. To demonstrate this, I wrote a simple example which indicates the performance differences between switch and if-else in many different situations.

Continue reading

Share:
Reading time: 9 min
.Net•Tools

Xenocode Postbuild The Application Failed To Initialize Properly (0xc000007b)

15 May 2008 by Ozcan Degirmenci No Comments

In one of my public projects, I used Xenocode PostBuild to obfuscate my codes. PostBuild is a very popular and common Obfuscation Tool for the .NET assemblies. When I worked for the Xenocode, I saw that the developers of PostBuild are really very good at doing their jobs. Most of them had worked for the Microsoft before. So I can say that if you need an obfuscation tool, you can use Xenocode PostBuild obfuscation tool without thinking a second.

Continue reading

Share:
Reading time: 1 min
.Net•C#

What Is The Best Way For Declaring Static Fields

25 April 2008 by Ozcan Degirmenci No Comments

Today I wrote a simple application, which shows what the difference is between initializing a static field in the explicit static constructor and doing the same during the declaration time (inline). I know that even when we initialize our static fields inline, the compiler will add an implicit static constructor to that class and initialize static values in that method. But this example showed me that there is really a long time difference between initializing static fields inline and in explicit static constructor. Here are a screenshot from the example – in this example BeforeFieldInit means that the static fields are initialized inline and NotBeforeFieldInit means that static fields are initialized in the explicit static constructor:

Continue reading
Share:
Reading time: 3 min
.Net

Capturing Screenshot And Paste Any Image To The Screen

12 February 2008 by Ozcan Degirmenci No Comments
Capturing Screenshot And Paste Any Image To The Screen

An example screenshot of the Screen Capturing

For a very long time ago, in one of my projects, I needed to capture the screenshot which must have to support both full screen capturing and specific regional capturing.

Also I need to paste that captured image back to the screen programmatically. At that moment I solved my problem by using some WinApi methods in the user32.dll and gdi32.dll. Here I want to share that code with you.

Continue reading

Share:
Reading time: 4 min
.Net

How To Find Sql Server On A Network

4 February 2008 by Ozcan Degirmenci No Comments

If you want to find MS SQL Servers which are available in a network, there are two different ways you can use for searching the network for available Sql Servers.

1 – There is a class in the .NET Framework which name is SqlDataSourceEnumerator in the System.Data.Sql namespace. We can use that class, and get the sql servers easly:

DataTable sqls = SqlDataSourceEnumerator.Instance.GetDataSources();

In this method we can only get the Sql Server machines on a network. There is also another method to get list of SQL Servers on a network. Also this second method can also be used to search for some other type of servers too. Here is the second method;

Continue reading
Share:
Reading time: 3 min
.Net

Create Object Instances Faster Than Reflection

2 February 2008 by Ozcan Degirmenci No Comments
Create Object Instances Faster Than Reflection

An example screenshot of the Test

Everybody knows that Reflection is a really very important topic in .NET. So I won’t repeat the importance of it, it is an unquestionable subject; besides, I have to admit that it saved my life too  many times.

But like every good thing Reflection has also some disadvantages, too. One of the important disadvantages of the Reflection is performance.

Continue reading
Share:
Reading time: 4 min
Page 2 of 3«123»

Search

Projects

  • Process Viewer
  • B-Msn
  • Runtime Member Proxies
  • Searchable RichTextBox

Categories

  • .Net (19)
  • C# (12)
  • General (13)
  • Open Source Projects (4)
  • Quantum (1)
  • Tools (9)
  • Visual Studio (6)

Archives

  • November 2018
  • September 2018
  • September 2010
  • August 2010
  • August 2009
  • September 2008
  • August 2008
  • June 2008
  • May 2008
  • April 2008
  • February 2008
  • January 2008

About me

Hi, my name is Ozcan Degirmenci. I'm co-founder and CEO at Crs Soft.

Tags

Assembly Collection Editor Dialog Support Dynamic method enum Flag Editor Loader Exceptions Ole Calls Open source project open source projects Perfornance Comparison process viewer Proxy quantum Reflection Run Apps From Web schrödinger's cat Searchable Richtextbox Spoon thought experiment thread

© 2018 copyright ÖZCAN DEĞİRMENCİ // All rights reserved.