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
S

sgatto159

@sgatto159
About
Posts
18
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Fake image url
    S sgatto159

    Hi everyone, here is my question: I've a hosted web application (no IIS access, I can only modify Web.config). What I want is that when someone request a resource like this: http://somewhere/some\_non\_existing\_path/bar.gif (where the directory "some_non_existing_path" doesn't exists!) .NET executes a class made by me (say MyClass.cs). I've tried with something like this: but I got the 404 error... How can I do that ?? Thank you in advance ;) ---------------------- !happy coding!

    ASP.NET question csharp windows-admin help learning

  • Automatic Letter generation
    S sgatto159

    If your users have Word2003, you can use native Word XML. In Word, save your template in xml with the name template.aspx. Add the file to the project, scriplet-it so that fields became value expressions (something like <%=emplName%>). Set content type to "application/msword" and the content-disposition to "attachment; filename='letter.doc'" hope this helps ;) ---------------------- !happy coding!

    Web Development csharp asp-net tutorial question

  • Regex.Replace hangs !!!
    S sgatto159

    Hi all, I'm trying to write some sort of forum with "forumcode" like snitz. To quote some text, user can surround it with [quote]...[/quote]. To do this I have written this regex:

    @"(?<quo_iniTag>\[quote\])(?<quo_text>.*)(?<quo_endTag>\[/quote\])"

    and the handler is something like this:

    if(m.Groups["quo_iniTag"].Value.Equals("") == false && m.Groups["quo_endTag"].Value.Equals("") == false)
    return "####"+m.Groups["quo_text"].Value+"###";

    But, sometimes (not always), it hangs forever on the method Replace. Can you help me please ? Thanks in advance ! ---------------------- !happy coding!

    C# regex help question

  • Page attribute &amp; concurrency
    S sgatto159

    leppie wrote:

    You can just save object instances there that will be persisted for the current session of the user, which is porbably what you are looking for

    Err... no. What I want is a method of passing objects between a class and it's subclass in a concurrent-access-safe-manner and only in the scope of a request/response (I need something like java's Request.setAttribute). ViewState is great, but IMHO only for intranet applications. But, if your answer is correct... I've found it. Thanks! ---------------------- !happy coding!

    C# csharp design question

  • Page attribute &amp; concurrency
    S sgatto159

    So it does not do some sort of object pooling ? for every request it creates an object from that class, serve the request, destroy the object ? :wtf: well... ok, thanks! ---------------------- !happy coding!

    C# csharp design question

  • Page attribute &amp; concurrency
    S sgatto159

    Hi, what if I have a Page subclass A.cs with a protected attribute "foo" and I use it in A.aspx.cs ? what if many users request page A ? what value of "foo" will they see ? Class A: public class A : System.Web.UI.Page { protected string foo; private void Page_Load(object sender, System.EventArgs e) { foo = "hi there " + Request["AUTH_USER"]; } ... Page A: <%@ Page language="c#" Codebehind="A.aspx.cs" AutoEventWireup="false" Inherits="some.A" %> <%=foo%> ... Thanks in advance for your reply

    C# csharp design question

  • Windows Forms: how to do automatic disposing? Here is my answer...
    S sgatto159

    Forget the garbage collector (comment that line). I've posted that snippet to share with the community this idiom of disposing components in C# Windows Forms applications. Hope this clarify the topic of this post. Thanks however for the suggestion (as I have already said, I am new to C#)

    C# question winforms performance tutorial announcement

  • Windows Forms: how to do automatic disposing? Here is my answer...
    S sgatto159

    I will read that (I' quite new to C#), but I don't like C++ ;)

    C# question winforms performance tutorial announcement

  • Windows Forms: how to do automatic disposing? Here is my answer...
    S sgatto159

    Second version: public static void disposeComponents(Component f, bool disposeForms) { foreach (FieldInfo fieldInfo in f.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic)) { object value = fieldInfo.GetValue(f); if(value is Form && disposeForms == false) continue; if(value is Form && f is Form) { if( ((Form)f).ParentForm == value ) continue; if( ((Form)f).MdiParent == value ) continue; } if(value is IDisposable && value != null) { ((IDisposable)value).Dispose(); fieldInfo.SetValue(f, null); } } System.GC.Collect(); }

    C# question winforms performance tutorial announcement

  • Windows Forms: how to do automatic disposing? Here is my answer...
    S sgatto159

    Hi all, here's a question for you. What if one needs to do automatic disposing of a form's components when it is closed ? And what if one wan't write Dispose() for each component ? Here is my answer, I hope you agree is correct. I tested it in win2k/winXp with taskmanager and I have seen this piece of code effectively release the memory when the form is closed. Suggestions are really appreciated./* Here f is the Form. This method is to be called in the Dispose method of the subclass of your Form. */ public static void disposeComponents(Component f) { foreach (FieldInfo fieldInfo in f.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic)) { object value = fieldInfo.GetValue(f); if(value is Component) { ((Component)value).Dispose(); fieldInfo.SetValue(f, null); } } System.GC.Collect(); }

    C# question winforms performance tutorial announcement

  • The object is currently in use elsewhere
    S sgatto159

    Hi all, I'working on a windows form c# mdi application. Sometimes (I can't reproduce the situation) I got a "The object is currently in use elsewhere". All I can tell is that it always happens in front of a gui event (form closing, form resizing, form activation and so on...). Does anyone know what the problem can be ? Thanks

    C# csharp help question

  • How to Use DropDownList in ASP.NET
    S sgatto159

    hum... 1- if that snippet is in a codebehind, than your class inherits from System.Web.UI.Page which does not contains SelectedItemCombo). So the question is: what is SelectedItemCombo ? 2- doing sql like that in callbacks is a bad idea 3- doing sql without try{}catch{}finally{} is even worst 4- replace while(thisReader.Read()) with: if(thisReader.Read()): is less confusing. But: why not DataSet? 5- replace if(strID == this.DropDownList1.SelectedValue.ToString()) with if(strID.Equals(this.DropDownList1.SelectedValue.ToString())) hope this helps

    C# csharp asp-net database sql-server sysadmin

  • having filefilter problem
    S sgatto159

    Write a method like this: public void findFiles(string where, bool recurse, params string[] what){ /*...*/ } so you can invoke without arrays: findFiles("c:\\", true, "*.mp3", "*.avi"); findFiles("d:\\", false, "*.mp3"); and so on. hope this helps

    C# help question

  • Regular Expression
    S sgatto159

    hope this helps (go to "Validating Unicode Characters"): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000004.asp[^]

    C# regex

  • having filefilter problem
    S sgatto159

    I think second parameter is a simple pattern, not a regexp. You can't do things like *.mp3|*.mpg

    C# help question

  • How to Use DropDownList in ASP.NET
    S sgatto159

    where is your databind() ? in page_load ? if I understand your problem, I'm quite sure you've not checked if ispostback before databind(). try (in Page_Load): /* ... */ if(IsPostBack == false) { /* ... */ DropDownList1.DataBind(); } /* ... */

    C# csharp asp-net database sql-server sysadmin

  • Dealing with dpi
    S sgatto159

    I don't see why not. Infact, I've found how to do it: g.PageUnit = GraphicsUnit.Millimeter; g.DrawRectangle(Pens.Black, 50, 50, 50, 50); does exactly what I need: without care of dpi draws in inches/millimeters/whatever.

    C# graphics help question

  • Dealing with dpi
    S sgatto159

    Hi all, can someone post a snippet of code that draws a rectangle of 2x3 inches ? I mean something that on every Graphics (and then with every sort of dpi) is 2x3 inches. I'm getting mad whit this.... please help ! thanks.

    C# graphics help 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