torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Friday, November 28, 2003
Teaser...
Next time we want to publish a new release of RSS Bandit. What do you think, what do you like? Do you want the "Update All Feeds" button back on the main toolbar? Should we provide an option to support also the older W2K style toolbar rendering?

Technorati tags:
Friday, November 28, 2003 10:34:43 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [4]  | 
# Tuesday, November 25, 2003
InternetGetCookie() in .NET
Sometimes there is a need to send cookies over the line on a call to HttpWebRequest.GetResponse(). The documentation about HttpWebRequest.CookieContainer: "... The CookieContainer property provides an instance of the CookieContainer class that contains the cookies associated with this request." That's really nice to have this support already there! But: how I get it setup on the first request? Often users already have a dozen cookies within their temporary internet files folder managed by Internet Explorer. How can I reuse these?
Bad news: there is no managed code support in the .NET Framwork to get them. Good news: we can use the Windows API support provided in wininet.dll to retrieve the cookies: InternetGetCookie(). So we can define the Interop declaration as follows:

[DllImport("wininet.dll", CharSet=CharSet.Auto , SetLastError=true)]
public static extern bool InternetGetCookie (
 
string url, string name, StringBuilder data, ref int dataSize);

That's it. To wrap the call we define a wrapper function:

private static string RetrieveIECookiesForUrl(string url) {
    StringBuilder cookieHeader =
new StringBuilder(new String(' ', 256), 256);
   
int datasize = cookieHeader.Length;
   
if (!InternetGetCookie(url, null, cookieHeader, ref datasize)) {
       
if (datasize < 0) 
           
return String.Empty;
        cookieHeader =
new StringBuilder(datasize); // resize with new datasize
        InternetGetCookie(url,
null, cookieHeader, ref datasize);
   
}
   
return cookieHeader.ToString();
}

OK, now we have the cookie content string, that looks usually like this: "KEY=Value; KEY2=what ever". Now we simply create managed cookies by creating instances of System.Net.Cookie. But stop! Did we really have to parse the cookie content string (aka cookie headers) to create the instances?
Again, good news: no, we did not have to do this. There is already build in support provided by the CookieContainer class we also need to set on the HttpWebRequest! The code:

public static CookieContainer GetCookieContainerForUrl(Uri url) {
    CookieContainer container =
new CookieContainer();
   
string cookieHeaders = RetrieveIECookiesForUrl(url.AbsoluteUri);
   
if (cookieHeaders.Length > 0) {
        try { container.SetCookies(url, cookieHeaders); } catch (CookieException){}
    }
   
return container;
}

Done :-)
Technorati tags:  |  | 
Tuesday, November 25, 2003 11:56:16 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [5]  | 
# Friday, November 14, 2003
Addendum: this.Site.MoveTo("webhost4life")

Attention to all BlogWorks XML users: if you want to migrate to dasBlog, please feel free to contact me for the .NET migration tool. If there are multiple requests I would add the code to the GDN fileshare. Don't reinvent the wheel.

Technorati tags:
Friday, November 14, 2003 12:46:08 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
Notable

Strait adrenaline. Inspired by a TV spot this week I visited the ghostrider site: special care to the trailers! Unbelievable that this is reality, not a stunt! I didn't recommend to drive this style, but you can get the kick... ;-)

Funny e-Mail client. Accidently found IncrediMail. And I thought, only Mac users really have fun with their machines and programs. On my machine I had some trouble importing my contacts and mails from Outlook 2003, it crashs each time I tried, maybe I should give the next Beta a chance.

Technorati tags:  | 
Friday, November 14, 2003 11:31:50 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
Match photos by color scheme

Royalty-free stock photo agency iStockPro has introduced a nifty Browse by Color dialog which lets you find photos that match your layout's color scheme. Neat!
[Jeffrey Zeldman Presents: The Daily Report]

Right, neat! Some examples: sample 1, sample 2.

Technorati tags:  | 
Friday, November 14, 2003 8:28:27 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Wednesday, November 12, 2003
no title
... to see, if I can post from w.bloggar also with categories.
Technorati tags:
Wednesday, November 12, 2003 6:03:57 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [4]  | 
# Sunday, November 09, 2003
Now it seems to work somehow
Just testing the mail a blog post feature of dasBlog, if it works, this entry should show up in a few minutes.
Technorati tags:  | 
Sunday, November 09, 2003 3:55:03 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
# Thursday, November 06, 2003
Web Hoster Change, Site moving...
If you got some problems the next few hours/days with this site: I'm about to switch my web host provider from Brinkster (that with ads on the right border), new WebHost4Life (thanks again to Thoemmi.NET).
Technorati tags:
Thursday, November 06, 2003 10:56:28 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
Web Hoster Wechsel
In den nächsten Stunden und Tagen kann es hier zu einigen Unregelmäßigkeiten kommen (Verfügbarkeit, etc.). Bin grad dabei meinen Web Hoster zu wechseln. Alt, derzeit: Brinkster (mit der komischen Werbung rechts), neu WebHost4Life (danke nochmal an Thoemmi.NET).
Technorati tags:
Thursday, November 06, 2003 10:53:00 AM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Sunday, November 02, 2003
Wetter per RSS
Hey, cool: die Wettervorhersage per RSS Feed, z.Bsp. für Memmingen [via Schockwellenreiter]
Technorati tags:
Sunday, November 02, 2003 7:39:02 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Saturday, November 01, 2003
Living with Brinkster: no
Brinkster [www.brinkster.com] host my web site(s) now for years. It seems I have to look for another free service more seriously now. Problems arising again and again. Some other people [e.g. diveintomark] like to have GoogleAds. But I don't like any ad on my pages while Brinkster force all free accounts to have one now. It is the ugly damn thing at the right side hiding all my shortcuts and links! And not to forgot: Brinkster don't like any .asp page with an embedded On error resume next if it is not switched back within the same function with a On error goto 0. This makes the simple use of any third party free .asp software a hard try and error upload task. No ftp upload/mail support on free accounts are just more points on the list.
Technorati tags:
Saturday, November 01, 2003 7:48:54 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [1]  | 
# Sunday, October 26, 2003
Kalt, aber schön
Das Wochenende hat uns von den Temperaturen her schon auf den Winter eingestimmt, aber dafür hatten wir den schönsten Sonnenschein während unseres heutigen Spaziergangs am See (Schachen, Anlegestelle). Unsere Kids und und auch unser Besuch aus Giesen war sichtlich angetan von der wunderschönen Herbststimmung. Hier nochmals: schön daß Ihr hier wart, Jutta, Olin, Fellice und Florence! Und Dir Olin: alles Gute in Boston!
Technorati tags:
Sunday, October 26, 2003 8:15:48 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
# Wednesday, October 15, 2003
Look and feel
Neither SharpReader nor RSS Bandit renders my business card nicely. They both strip out or otherwise deactivate the CSS tags that are used in rendering the card. So go my web site if you want to see the card "for real". Raises an interesting question. How much support should syndication feeds like RSS have for look and feel? [Harry Pierson's DevHawk Weblog]
I think the main goal of a RSS Reader is to syndicate feed informations, with stress on information. So a consistent GUI is more important than to get an idea of the personal preferences of colors/design of each individual. But there are always links within the detail view: at the top to the main blog page, and within Read On... directly to the post itself.
Technorati tags:
Wednesday, October 15, 2003 9:27:46 PM (W. Europe Daylight Time, UTC+02:00)    #  Comments [0]  | 
Re: Outlook 2003 sucks
Don't think so: Outlook 2003 Sucks Ass. Bigtime. [Chris Pirillo] I'm not always with Microsoft, but I really like Outlook2003 (compared to v.2000). I'm happy with the hotmail account integration, search folders, per account signatures, my last beta of Cloudmark Spam filter still runs, the new GUI. I don't like: my rules does not apply/work in Offline mode, archived mails (.pst) are incompatible with 2000 archives. Constructional criticism is a better base to discuss on.
Technorati tags:
Wednesday, October 15, 2003 8:09:23 PM (W. Europe Daylight Time, UTC+02:00)    #  Comments [1]  | 
Howto: [assembly: AssemblyKeyName("")]
Takes me a half hour today to figure out how to get the assembly attribute AssemblyKeyName to work. The normal provided MSDN docs are always describing the way how to use the AssemblyKeyFile attribute and simply hint: "... or install the key into the CryptoServiceProvider (CSP)". I didn't like the idea to provide the company keypair file to each dev.Machine. So here it is:
once> sn.exe -k companyKeyPair.snk
each dev.client> sn.exe -i companyKeyPair.snk CompanyKey

AssemblyInfo.cs: AssemblyKeyName("CompanyKey")]
Technorati tags:
Wednesday, October 15, 2003 7:15:32 PM (W. Europe Daylight Time, UTC+02:00)    #  Comments [1]  | 
# Tuesday, October 14, 2003
User Sample

Posted my piece of code to embed the IE WebBrowser control in .NET without wrapping DLL's [.NET] as a GDN User Sample In general it is a rework of the code posted here, but with some extensions I needed and without saving static html to temporary file to navigate to later. The crux of matter is how to define the correct Interop for IHTMLDocument2.Write().
Here is my working solution:

using System;
using System.Runtime.InteropServices;

namespace System.Windows.Forms.Html {
  [InterfaceType(ComInterfaceType.InterfaceIsDual), ComVisible(true),   Guid(@"332C4425-26CB-11D0-B483-00C04FD90119")]
  interface IHTMLDocument2 {
    ...     
    ///

    
    /// Write complete html doc content including markup.
    ///
    /// object[] containing the string(s)
    ///
    ///
    /// IHTMLDocument2 document = control.GetDocument();
    /// if (document != null) {
    /// document.Open("", null, null, null);
    /// object[] a = new object[]{"Hello world"};
    /// document.Write(a);
    /// document.Close();
    /// }
    ///
    ///

    void Write(
      [In, MarshalAs(UnmanagedType.SafeArray)] object[] psarray);
    ...
  }
}

May be there is an Interop Guy that is able to solve it in a more elegant way? Currently IJW. This functionality is covered by the control itself. Usage of that feature of IE Control looks like this:

htmlControl.Html = myHtmlString;
htmlControl.Navigate(null);

With this approach you will also get the NavigateXYZ() events to listen for further usage.

Technorati tags:  | 
Tuesday, October 14, 2003 8:26:12 PM (W. Europe Daylight Time, UTC+02:00)    #  Comments [3]  | 
# Friday, October 10, 2003
No Autumn anymore
Two days ago we had the first snow this year. Yes, it was October, the 8. Unbelievable after that hot summer time. So it seems the winter season follows immediately the summer this year
Technorati tags:
Friday, October 10, 2003 4:17:56 PM (W. Europe Daylight Time, UTC+02:00)    #  Comments [0]  | 
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
On this page....
<November 2003>
SunMonTueWedThuFriSat
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll

newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Join WebHost4Life.com