?

Log in

ms_dot_net

Graphics.DrawString

Apr. 14th, 2010 | 12:29 pm
location: Work
mood: confusedconfused
posted by: owenblacker in ms_dot_net

I'm getting very frustrated with trying to generate text on images in .Net. Whilst the process to do so is pretty simple, the results one gets simply aren't that satisfactory.

I have the following code (really very simple, as you can see) in an IHttpHandler, which I call in a loop to iterate through some of the fonts on my system as a proof-of-concept:

Far more detail here, behind a cut so as not to confuse / irritate all my non-techy friendsCollapse )

Link | Leave a comment {1} | Share

ms_dot_net

Smart tag – Simple usage

Jan. 7th, 2010 | 06:39 pm
posted by: violet_tape in ms_dot_net

Intro


For a long time I was wandering how easy and comfortable to work with smart tags. Actually I didn’t knew how it was called officially, but anyway I thought (and still think) that this feature is awesome! Some time ago I’ve started to develop my own components and also spend more time tuning user’s interface. I found that it’s very time consuming and boring to setup necessary properties from the Property view. Its okay to setup few controls in little program, but when you have over 30 complicated views with custom components – you quickly became in a sad mood. So I decide found out how to create for my controls those pretty little triangles on the top right corner at the most standard components.

I found articles, books; I performed several tests and finally made what I want. And you know, it’s really helps me with development! Time saving in action! )

Now I’d like to share how to make it from the very beginning.

For all described actions below I used VS2008, ReSharper5

Read more...Collapse )

Link | Leave a comment | Share

ms_dot_net

Forms authentication help

Dec. 25th, 2009 | 02:41 pm
posted by: larryv in ms_dot_net

A website I built for a client was given a security audit. Most of the stuff they came back with was relatively simple to implement but there was one that I can't find consise step by step instructions on how to implement on the web. It was with regards to the password. For this application the password is stored in the web.config file in clear text:
     <authentication mode="Forms">
        <forms loginUrl="~/admin/login.aspx" defaultUrl="~/admin/default.aspx" protection="All" timeout="30">
          <credentials passwordFormat="Clear">
            <user name="clientname" password="p@55w0rd" />
          </credentials>
        </forms>
      </authentication>

The reccomendation they gave was:
It is required to set the password format to a secure hashing method. Passwords should always be stored in a hashed form not in clear text. Also the password will have to be salted before a hash is created. Do not use weak or broken ciphers such as SHA1 or MD5. At a minimum, use SHA2 with a minimal of 256 bit encryption (a.k.a. SHA256).

Given that, can someone tell me what I have to change in my web.config and (I am assuming) in my login.aspx.cs?

Link | Leave a comment | Share

ms_dot_net

Features of Sharp IMG Viewer 2008 in detail

Dec. 19th, 2009 | 11:04 am
mood: working
posted by: mikegratsas in ms_dot_net

Introduction


Developing software and designing images you often need to extract them from some external source, apply some transformations and conversions, save prepared images and then use in your developed applications. Performing these steps you can find useful some interesting features of Sharp IMG Viewer 2008.


Sharp IMG Viewer 2008 is a resource explorer which lets to open images, extract from various sources, save images in other formats, view image properties including metadata and perform operations on selected images.


This article describes the methods available to import images from assemblies, archives, disk image files, virtual disk files, Windows executables, resources, compound and compiled help files. You are supposed to know main Microsoft Windows architecture principles.


Read moreCollapse )

Link | Leave a comment | Share

ms_dot_net

My new blog

Dec. 5th, 2009 | 01:51 am
posted by: level42 in ms_dot_net

http://bit.ly/8OKoad

Link | Leave a comment | Share

ms_dot_net

mono anyone?

Nov. 29th, 2009 | 05:13 am
posted by: level42 in ms_dot_net

has anybody here used it?
specifically for asp.net projects.

thx in advance.

Link | Leave a comment | Share

ms_dot_net

Whysharper: stackoverflow plugin for R#

Sep. 3rd, 2009 | 06:25 pm
posted by: starik_x in ms_dot_net

Just installed an interesting plugin for ReSharper: Whysharper.

It dovetails ReSharper and stackoverflow.com. Every now and then people ask "why R# recommends this" kind of questions - with Whysharper you can click on the corresponding "why" and read over a detailed discussion at stackoverflow.



For now, looks like only a dozen suggestions is covered but existing ones are pretty interesting - and hopefully it will be more to follow :)

Link | Leave a comment | Share

ms_dot_net

IIS Application config wildcards

Jun. 10th, 2009 | 03:18 pm
posted by: larryv in ms_dot_net

I have an application in IIS where I set up a wildcard so that all file extensions are processed via the .net dll. I did this so that I can process some URL rewriting. I see at the top of the configuration screen where I can specify which extensions should be processed by what processors. What I am wondering is if there is a way to specify an extension that should not be processed by the wildcard. Specifically I know that .jpg, .gif, .css, .png and .js extensions should not go through it. Is there a way to tell IIS to just serve them normally?

Link | Leave a comment | Share

ms_dot_net

Client-side validation

Feb. 27th, 2009 | 05:13 pm
location: Work
mood: frustratedfrustrated
music: Linkin Park — Numb
posted by: owenblacker in ms_dot_net

I’m having some “fun” with client-side validation on a roll-my-own BaseValidator subclass.

My validator is to validate email format and includes the following code (with XMLdoc removed for brevity):

using System;
using System.Text.RegularExpressions;

namespace IrisDigital.WebControls.Validation
{
   [System.Web.UI.ToolboxData("<{0}:EmailValidator runat='server'/>")]
   public class EmailValidator : BaseValidator
   {
      protected override void AddAttributesToRender(System.Web.UI.HtmlTextWriter writer)
      {
         base.AddAttributesToRender(writer);

         if (base.RenderUplevel)
         {
            writer.AddAttribute("evaluationfunction", "CheckEmailFormat");
            writer.AddAttribute("controltovalidate", this.GetControlRenderID(this.ControlToValidate));
         }
      }

      protected override bool EvaluateIsValid()
      {
         // ...
      }

      protected override void OnPreRender(EventArgs e)
      {
         base.OnPreRender(e);

         if (base.RenderUplevel)
         {
            if (!Page.ClientScript.IsClientScriptBlockRegistered("IrisDigital.WebControls.Validation.EmailValidator"))
            {
               Page.ClientScript.RegisterClientScriptInclude("IrisDigital.WebControls.Validation.EmailValidator",
                  Page.ClientScript.GetWebResourceUrl(this.GetType(), "IrisDigital.WebControls.Validation.EmailValidator.js"));
            }
            this.ClientValidationFunction = "CheckEmailFormat";
         }
      }

Most of the rationale for doing things this way is from an article on CodeProject: RequiredIfValidator — Extending from the BaseValidator class, which does it precisely this way.

The validator works wonderfully. But the client-side validation never fires.

The WebResource correctly gets added to the page as a script include (for which I need to have the following line in my AssemblyInfo.cs, in case you were wondering):

[assembly: System.Web.UI.WebResource("IrisDigital.WebControls.Validation.EmailValidator.js", "text/javascript")]

, but it just never gets called.

Anyone got any ideas why?

Cross-posted to csharp and owenblacker.

Link | Leave a comment | Share

ms_dot_net

Accessing an XML-RPC service

Aug. 11th, 2008 | 05:35 pm
location: Work
mood: frustratedfrustrated
music: Með suð í eyrum við spilum endalaust — Sigur Rós
posted by: owenblacker in ms_dot_net

I'm trying to access an XML-RPC service from C# that I'm building. I've had absolutely no response from my message on the XML-RPC.net YahooGroup, so I started looking at the only other .Net XML-RPC class library out there: XmlRpcCS, which is only confusing me further.

The cause of my problems appears to be that XML-RPC.Net seems to require all its proxy objects to be structs. I, however, would like to use class objects, so I can add other functionality into the classes (constructors, the ability to have properties that are masked from the XML-RPC output and so on).

Now if this were XML serialisation, I would use the attributes that control XML serialisation, such as [XmlIgnore]. Without rewriting half of the class library, though (which would seem to defeat the purpose of using it!), I can't do something like that.

Does anyone here have any experience of using an XML-RPC library for .Net?

(Cross-posted to csharp.)

Link | Leave a comment {1} | Share