Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

matt cole

@matt cole
About
Posts
15
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to Encrypt Data and Save to Registry ?
    M matt cole

    With replies like that you can see why they made him an MVP :P

    C# windows-admin tutorial question

  • Working around the lack of friend classes
    M matt cole

    Hi, I have a situation where I have a class which I would like to be visible within its assembly, but only to be able to be created by a single other class. Ideally I would make the constructor private and the other class a friend and this would solve the problem, but that's not possible in c#. I was hoping there may be some special property of a nested class to allow this but it doesn't seem so. Can anyone think of another way to do this? Thanks, Matt

    C# csharp help question

  • Convert.ToBase64 question
    M matt cole

    Yeah my actual code does deal with it as a stream but it generates the same string as the Image.Save(memoryStream) method. Basically I'm using a third party charting component which has a save method which is able to save to a stream, I assume it uses the same method as the Image.Save does as it generates the same base64 string. I was hoping if i could get to the bottom of the reason I am getting two different strings I could take that solution to my actual code. I can see now that the string is exactly the same, except the file IO method has more bytes on the end that are missing from the other method.

    C# csharp asp-net graphics xml performance

  • Convert.ToBase64 question
    M matt cole

    [Message Deleted]

    C# csharp asp-net graphics xml performance

  • Convert.ToBase64 question
    M matt cole

    Hi Andy, I didn't actually even save the image programatically, as I mentioned the snippet I've pasted in isn't the actual code I'm working with it's just a test that I wrote up to see what the problem was in my actual code. The image on disk has just been saved straight from a browser so I could use it in the test. Don't know if this makes any difference to you? Thanks, Matt

    C# csharp asp-net graphics xml performance

  • Convert.ToBase64 question
    M matt cole

    [Message Deleted]

    C# csharp asp-net graphics xml performance

  • Convert.ToBase64 question
    M matt cole

    Hi, I'm trying to get a base64 string from an image to place inside a WordProcessingML xml document. I need to save the image to a stream after it's generated through asp.net, that is, I'm not able to use the file system. For some reason, I seem to get a different string loading something from the file system and using file streams and binary readers, as opposed to when I use Image.Save and a memory stream. I've pasted some sample code below, it's not my actual code that I'm working with but simulates the situation. The two methods generate different strings from the same image file. If I reverse the process, and take the two generated strings and load them into an image, both work fine. No doubt there is some obvious encoding issue or something that I'm sadly unaware of so if anyone had any ideas that'd be great. FileStream fs = File.OpenRead(@"C:\temp\chart.png"); BinaryReader br = new BinaryReader(fs); string pngString = Convert.ToBase64String(br.ReadBytes((int)fs.Length)); MemoryStream memStream = new MemoryStream(); Image image = Image.FromFile(@"C:\temp\chart.png"); image.Save(memStream,System.Drawing.Imaging.ImageFormat.Png); string memString = Convert.ToBase64String(memStream.GetBuffer()); Thanks, Matt

    C# csharp asp-net graphics xml performance

  • SQL Query Question
    M matt cole

    Thanks Jon, That works perfectly :)

    Database database help question

  • SQL Query Question
    M matt cole

    Hi, I have a question about a sql query I need to do. I have a table with 3 fields, userID, entryDate and value. My query will have a date parameter called targetDate. What I was hoping to do was retrieve a single row for each user where the entryDate is the most recent entry for that user prior to the targetDate parameter. If there are no entries prior the the targetDate for the user, no rows will be returned for that user, if they have multiple entries with entryDate < targetDate, obviously only the most recent will be returned. If anyone was able to help me with the SQL for this, that'd be great. Thanks, Matt

    Database database help question

  • XSD Problem
    M matt cole

    Hi, I'm pretty much a newbie to xsd's in general, and have a case in a schema I'm designing that I'm not sure how to solve. Basically I have a situation like this: Standard Special where the parent node type is the same, but depending on the value of the category node, subsequent nodes are different. I thought a good solution would be to have a xs:choice, where each choice has a fixed value for the category node and then the relevant subsequent nodes follow but I get a Unique Particle Attribution violation as both choices have the category node. Is there a solution for this type of situation or will i have to workaround it somehow? Thanks very much, Matt

    XML / XSL database xml help tutorial question

  • dynamic casting
    M matt cole

    Hi, I have an object "obj" that is a TypeA. I have a Type object that refers to TypeA. How can I cast obj to TypeA? TypeA is dynamically created from a loaded assembly, so I need to be able to do it dynamically. Or altenatively is there another way to get at obj's fields defined by the TypeA interface ? thanks, Matt

    C# question

  • attributes
    M matt cole

    Hi, I've defined an attribute type which is used on classes. I've written code that loads an assembly, iterates all the types defined in the assembly and search for types that have that attribute. This all works fine and in the debugger i can see that it is finding the attribute on the class. However I can't cast it from a generic System.Attribute to my own custom attribute type. If I use the Type.GetCustomAttributes overload that takes an attribute type as an argument and pass it my custom attribute type it doesn't find any. The debugger shows the attributes that I'm finding as being my custom type when i call GetCustomAttributes with no type. Any ideas? Code snippet: attributes = type.GetCustomAttributes(false); if(attributes.Length != 0) { // check to see if it's what we are after foreach(System.Attribute attribute in attributes) { Transformer transformer = attribute as Transformer; if(transformer != null) transformers.Add(new DataTransformer(transformer.ID,transformer.DisplayName,transformer.FileExtension,assembly,type)); } } any explicit casts also fail. Transformer is my custom attribute type and the debugger shows the attribute to be of that type.

    C# ai-models debugging question

  • Creating db table from DataTable
    M matt cole

    lol dagnammit :) i didn't think so but thought i'd check.

    Database database question

  • Creating db table from DataTable
    M matt cole

    Hi, I'm just wondering if it's possible to create a new table in a database based on a programatically generated DataTable without having to do it by hand? thanks, matt

    Database database question

  • HttpModule
    M matt cole

    Hi, I'm writing a statistics tracking project, and I'm hoping to record all requests for all pages across my site. I'm using a HttpModule to intercept all the requests and get all the info out of them. However, this only intercepts calls to asp.net pages. I'm wondering how if at all I can manage to catch calls to all pages on my site? or even a subset, e.g htm,asp pages. I tried routing the asp pages through the asp.net dll but unsuprisingly it didn't work. Has anyone managed to get this working before? Thanks, Matt

    ASP.NET csharp asp-net question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups