1. Passing data in JPG

    Date: 11/16/07     Keywords: asp, web

    I have the need to pass data in a JPG image.

    That is, I'm generating the JPG image dynamically using GDI+ in .NET from an ASP.NET call. What I need to do is place some data into the JPG, say a GUID, and be able to read it back when I load the JPG from the web site where it is displayed.

    I surely can't do this with the actual image data, as my understanding is that JPG is run-encoded and getting data in and out would be a bear.

    Are there any metadata headers in JPG that I have access to? Anyone know of or have any C# code to read and write these?

    Source: http://community.livejournal.com/csharp/88978.html

  2. seriously getting tempted to learn to read Russian...

    Date: 11/14/07     Keywords: no keywords

    what are they not telling us? :)

    Source: http://community.livejournal.com/csharp/88741.html

  3. структуру С++ - в программу на С#

    Date: 11/04/07     Keywords: no keywords

     Существует ли способ вставить в программу на С# код структуры С++, где поля по умолчанию public ?

     

    {

     

     

     

     

    };
    Спасибо.

    struct CPPStructint x12;int y12;float z12;char ch12;

    Source: http://community.livejournal.com/csharp/88553.html

  4. структуру С++ - в программу на С#

    Date: 11/04/07     Keywords: no keywords

     Существует ли способ вставить в программу на С# код структуры С++, где поля по умолчанию public ?

     

    {

     

     

     

     

    };
    Спасибо.

    struct CPPStructint x12;int y12;float z12;char ch12;

    Source: http://community.livejournal.com/csharp/88205.html

  5. Scripting in C#

    Date: 10/25/07     Keywords: database, microsoft

    I work in a project, where we need to do tons of validations. The problem is, that hard coding would take weeks. So we thought about using short scripts, which we could store in a database. Using a search engine, I found, that there's an API to the JScript and VBScript engine in the .net framework (Microsoft.Vsa, Microsoft.JScript.Vsa and Microsoft.VisualBasic.Vsa). But when I looked in the class library reference, there was a "obsolete" mark on all three namespaces.

    Does anyone know an open source scripting engine we could use? Or does someone know a way to solve our problem?

    Source: http://community.livejournal.com/csharp/87853.html

  6. Text from multi line text box keeping multi line.

    Date: 10/09/07     Keywords: no keywords

    I have a program (VS 2005) that is taking user input in a multi line text box and then is taking it, converting it to WordML, and putting it in a word document. The problem is that I'm not sure how I can keep the formatting of the multi line through to put on the word doc. Its basically an address field, and I don't want to have to make like 4 single line address boxes and then throwing them all in individually. Is there any way to keep the multi line formatting while I'm transferring the info? I tried the /n or whatever for the new line, but that doesn't seem to work. Perhaps I'm implementing it wrong, but I'm not sure. Also I have another section where I have a static multi line address field that I can't get to do the multi line thing correctly either. Does it look like I just need to make a bunch of single line text fields and merge them, or is there a real solution to this? Thanks.

    Source: http://community.livejournal.com/csharp/87220.html

  7. Constructor Failure

    Date: 10/05/07     Keywords: no keywords

    Hey guys. I know I've seen this before, but I can't, for the life of me, remember how to do it or where I saw it . . .

    I need to tell a constructor to fail. Basically, I'm wrapping some unmanaged calls to a system DLL. I need to tell the class constructor to gracefully catch the exception and return null if there was an error in the constructor. Anyone know / remember how to do this?


    public class ServiceInternalInstaller {
    	[DllImport( "advapi32.dll" )]
    	public static extern IntPtr OpenSCManager( string lpMachineName, string lpSCDB, int scParameter );
    
    	private IntPtr m_pSCM = IntPtr.Zero;
    
    	public ServiceInternalInstaller() {
    		const int SC_MANAGER_CREATE_SERVICE = 0x00000002;
    			try {
    			m_pSCM = OpenSCManager( null, null, SC_MANAGER_CREATE_SERVICE );
    			if( m_pSCM == 0 ) {
    				throw new Exception( GetLastErrorMessage() );
    			}
    		} catch( Exception e ) {
    			Console.Error.WriteLine( e.Message );
    		}
    	}
    }
    
    ...
    
    ServiceInternalInstaller oInstall = new ServiceInternalInstaller();
    if( oInstall == null ) return;
    


    I left a few things out for the sake of brevity. It's a little crude, but that should give you the idea.


    Thanks.

    Source: http://community.livejournal.com/csharp/86684.html

  8. debugger caching?

    Date: 10/03/07     Keywords: no keywords

    I've got an issue with MS Visual C# express edition. Most of the time when I run my app in debug mode (F5) it runs some older version of the code, not the one I currently have. When I run without the debug mode (Ctrl + F5), it runs the current version just fine. I'm assuming it's some sort of a caching info.. any help will be very appreciated :)

    Thanks.

    Source: http://community.livejournal.com/csharp/86497.html

  9. RepeaterItemEventHandler

    Date: 09/27/07     Keywords: web

    hello the mighty c# developers! so far so good!

    I have Repeater with LinkButton

    'runat="server" ID="CancelAutorenewLinkbutton">
                                            Cancel Autorenew
                                       




    I want this LinkButton to activate the following function

    private void CancelAutorenewLinkbutton_click(object sender, RepeaterCommandEventArgs e)
    {
    int PurchaseID = Int32.Parse(e.CommandArgument.ToString());
    Purchase curPurchase = PaymentManager.GetPurchase(PurchaseID);
    }

    but I don't know how to register it
    I've tried adding to InitializeComponent
    this.CancelAutorenewLinkbutton.Command += new System.Web.UI.WebControls.CommandEventHandler(CancelAutorenewLinkbutton_click);

    but it doesn't work. I'm getting compilation error. Do you know how to do it?hello the mighty c# developers!

    Source: http://community.livejournal.com/csharp/86055.html

  10. Dynamic Detection?

    Date: 07/19/07     Keywords: browser, web

    I'm looking for a good article that will help me do the following:

    I have an application that has a toolbar. The toolbar contains a number of objects derived from ToolStrip.

    I would like to put each ToolStrip object into its own assembly and deploy them with the main application. At run time, I would like the main application to enumerate all of the DLL files and detect which of them contain one of my ToolStrip objects. To make this work, I suspect I'll have to have each object also implement a known interface that I can create that will positively identify it.

    I can then load the DLLs, instantiate the objects in them and use them. This will allow me to push updates with xcopy deployment and allow other developers to develop toolbars as well.

    So I have a general idea how to do this, but if anyone knows of a good article on this technique, that would be terribly helpful. I've scanned CodeProject already, but I might have missed it.

    PS: Thanks for the suggestions on the web browser code. I did find some example code that got me on my way (and this is part of that project, in fact).

    Source: http://community.livejournal.com/csharp/85896.html

  11. Replacing strings...

    Date: 07/15/07     Keywords: no keywords

    Hi, just joined!

    I'm working on a program which has to generate reports based on some data. I want to be able to specify a template for the report, using placeholders like %a or %b for various bits of data.

    Seems like this should be extremely simple, using the String.Replace method, however I'm trying that and nothing at all is getting replaced. Here's an example:

    TextWriter tw = new StreamWriter(filename);
    
    String headerText = header.Text;
    headerText = headerText.Replace("&&", "&");
    headerText = headerText.Replace("&t", trainerName.Text);
    headerText = headerText.Replace("&a", tradable.ToString());
    headerText = headerText.Replace("&w", wanted.ToString());
    headerText = headerText.Replace("&d", diamondFriendCode.Text);
    headerText = headerText.Replace("&p", pearlFriendCode.Text);
    headerText = headerText.Replace("&b", battleRevFriendCode.Text);
    headerText = headerText.Replace("&", "&");
    
    if (displayHeader.Checked)
         tw.WriteLine(headerText);


    Here's the contents of the form element "header:"

    %t's trade list
    Friend codes:
    Diamond: %d
    Pearl: %p
    Battle Revolution: %b


    And here's the output from the program for that portion, which of course is identical to the input:

    %t's trade list
    Friend codes:
    Diamond: %d
    Pearl: %p
    Battle Revolution: %b


    Any ideas?

    Source: http://community.livejournal.com/csharp/85552.html

  12. Web Browser code in C#

    Date: 07/12/07     Keywords: browser, web

    I'm looking for a starting point: a web browser written in C# that I can then customize for a proof of concept. I've checked CodeProject, but nobody's written a decent one that I can see.

    Encapsulating the System.Windows.Forms.WebBrowser object in .Net 2.0 would be more than good, if the project then hooked all the events and provided customizable controls.

    The goal here is to then add logic that does pre-processing on web pages as they come in.

    Other than CodeProject, does anyone have a suggestion on where I might look for available code?

    Source: http://community.livejournal.com/csharp/85332.html

  13. TargetInvocationException

    Date: 05/04/07     Keywords: no keywords

    Hi, I need advise:

    private object _o; /* Apollo object */
    private System.Type t; /* for COM ProgID */

    t = Type.GetTypeFromProgID("ApAuto");
    _o = new object();
    _o = Activator.CreateInstance(t);

    int[] its = new int[1000];
    args[0] = (object)(this._SectionID);
    args[1] = its;

    bool ret;
    ret = (bool)t.InvokeMember("GetItemList", System.Reflection.BindingFlags.InvokeMethod, null, this._o, args);

    And I'm getting [System.Reflection.TargetInvocationException] = {"Exception has been thrown by the target of an invocation."} on t.InvokeMemeber.

    My opinion there is something wrong when I'm passing array as a parameter, but I'm not sure.

    There is also description of GetItemList function:

    GetItemList
    Description: GetItemList retrieves an array of the Record IDs for all items in a section.

    Syntax: bool GetItemList (long SectionID, variant far *ItemArray)

    Elements: SectionID Identifier of the section with the data to retrieve.
    ItemArray Array of items in the section.

    Please let me know what am I doing wrong.
    Thank you.

    Source: http://community.livejournal.com/csharp/85062.html

  14. Composite Controls

    Date: 05/03/07     Keywords: no keywords

    Hey guys. I'm having a problem writing a Composite Server Control, so I figured I'd actually try to post a question here. The Composite Control is basically a Label and a DropDownList. My problem is that anytime the a PostBack occurs, I lose the SelectedIndex. Anyone have any suggestions? I'll provide part of the code behind the cut :



    		public class AddNewDropDownListEventArgs : EventArgs {
    			private String m_sNewValue;
    
    			public String NewValue {
    				get { return m_sNewValue; }
    			}
    
    			public AddNewDropDownListEventArgs( String newValue ) {
    				m_sNewValue = newValue;
    			}
    
    			/// 
    			/// Keeps the user from having to cast it out from being an EventArgs
    			/// 
    			/// this.NewValue
    			public override string ToString() {
    				return m_sNewValue;
    			}
    		}
    
    		/// 
    		/// A DropDownList and optional Label that contains an special element that allows the user to add new elements to the list
    		/// The Special elements are not added until the OnPreRender phase, so the list will act normal until that point.
    		/// 
    		public class AddNewDropDownList : UserControl, INamingContainer, IPostBackEventHandler {
    			protected Label m_oLabel;
    			protected DropDownList m_oDropDownList;
    			public event EventHandler AddNew;
    
    			public String Label {
    				get { return (String)ViewState["Label"]; }
    				set { ViewState["Label"] = value; }
    			}
    
    			public ListItemCollection Items {
    				get { return m_oDropDownList.Items; }
    			}
    
    			public int SelectedIndex {
    				get { return m_oDropDownList.SelectedIndex; }
    				set { m_oDropDownList.SelectedIndex = value; }
    			}
    
    			public ListItem SelectedItem {
    				get { return m_oDropDownList.SelectedItem; }
    			}
    
    			public bool IncludeBlankItem {
    				get {
    					if( ViewState["IncludeBlankItem"] == null ) {
    						return true;
    					}
    					return (bool)ViewState["IncludeBlankItem"];
    				}
    				set { ViewState["IncludeBlankItem"] = value; }
    			}
    
    			public AddNewDropDownList() {
    				m_oLabel = new Label();
    				m_oDropDownList = new DropDownList();
    			}
    
    			public void RaisePostBackEvent( string eventArgument ) {
    				if( AddNew != null ) {
    					AddNew( this, new AddNewDropDownListEventArgs( eventArgument ) );
    				}
    			}
    
    			#region AddNewItems
    			// There are a lot of overloads for this function
    			// basically, it added the new item right before the [ Add New ] Item
    			// optionally, it selects it
    			#endregion
    
    			protected void CreateSpecialItems( bool bCreateBlankItem ) {
    				if( bCreateBlankItem ) Items.Insert( 0, new ListItem( String.Empty, String.Empty ) );
    				Items.Add( new ListItem( "[ Add New ]", "[ Add New ]" ) );
    			}
    
    			protected override void CreateChildControls() {
    				// null means don't render, String.Empty means render
    				// This way, the label can be created for client-side dynamic updating
    				if( Label != null ) {
    					m_oLabel.Text = Label;
    					Controls.Add( m_oLabel );
    				}
    
    				Controls.Add( m_oDropDownList );
    
    				base.CreateChildControls();
    			}
    
    			protected override void OnInit( EventArgs e ) {
    				if( !IsPostBack ) {
    					CreateSpecialItems( IncludeBlankItem );
    				}
    
    				base.OnInit( e );
    			}
    
    			protected override void LoadViewState( object savedState ) {
    					if( IsPostBack ) {
    						ArrayList aItems = (ArrayList)ViewState["anddlItems"];
    						foreach( ArrayList aItem in aItems ) {
    							Items.Add( new ListItem( aItem[0].ToString(), aItem[1].ToString() ) );
    						}
    					}
    				}
    
    			}
    
    			protected override void OnPreRender( EventArgs e ) {
    				m_oLabel.ID = "Label";
    
    				m_oDropDownList.ID = "DropDownList";
    				m_oDropDownList.Attributes["onchange"] = "getNewItem( this, '" + this.UniqueID + "' );";
    
    				StringBuilder sGetNewItemScript = new StringBuilder();
    				sGetNewItemScript.Append( "function getNewItem( oControl, sUniqueID ) {\n" );
    				sGetNewItemScript.Append( "\tif( oControl.options[oControl.selectedIndex].value == '[ Add New ]' ) {\n" );
    				sGetNewItemScript.Append( "\t\tvar retVal = prompt( 'Please input the new value.' );\n" );
    				sGetNewItemScript.Append( "\t\tif( ( retVal != null ) && ( retVal != '' ) ) {\n" );
    				sGetNewItemScript.Append( "\t\t\t__doPostBack( sUniqueID, retVal );\n" );
    				sGetNewItemScript.Append( "\t\t}\n" );
    				sGetNewItemScript.Append( "\t}\n" );
    				sGetNewItemScript.Append( "}\n" );
    
    				Page.ClientScript.RegisterClientScriptBlock( this.GetType(), "GetNewItem", sGetNewItemScript.ToString(), true );
    
    				base.OnPreRender( e );
    			}
    
    			protected override object SaveViewState() {
    				ArrayList aItems = new ArrayList();
    				foreach( ListItem oItem in Items ) {
    					ArrayList aItem = new ArrayList();
    					aItem.Add( oItem.Text );
    					aItem.Add( oItem.Value );
    					aItems.Add( aItem );
    				}
    
    				ViewState["anddlItems"] = aItems;
    				return base.SaveViewState();
    			}
    		}
    
    	}
    }

    Source: http://community.livejournal.com/csharp/84955.html

  15. ProgressBar Status

    Date: 04/26/07     Keywords: no keywords

    I'm still pretty new to C#. How do I implement the following to work correctly (the status is updated)? I want to show an accurate percentage of the progress bar. Ignore the extra figures after the decimal point.

            private void button1_Click(object sender, EventArgs e)
            {
                timer1.Start();
                button1.Enabled = false;
            }
    
            private void timer1_Tick(object sender, EventArgs e)
            {
                if (progressBar1.Value == progressBar1.Maximum)
                {
                    timer1.Stop();
                    button1.Enabled = true;
                    label3.Text = "100%";
                    return;
                }
                progressBar1.PerformStep();
                double x = (progressBar1.Value/progressBar1.Maximum) * 100.0;
                label3.Text = String.Format("{0}%", x);
    
            }
    

    Thanks!

    Source: http://community.livejournal.com/csharp/84502.html

  16. Porting from C++ to C++/CLI and C#?

    Date: 04/20/07     Keywords: software, java

    I'm involved in porting a C++ application over to C++/CLI and C#, and I was wondering if anyone had any suggestions on good references for a C++ programmer transitioning to .NET? The application itself will most likely use C# for the GUI, and C++/CLI calling unmanaged C++ for computation.

    I'm primarily interested in references that could assist in transitioning to a new architecture, but also in others that focus on language specifics: syntax, best practice, etc.

    I'd also appreciate intelligent comments from those who've been through a similar torture port!

    I've got solid experience in OO software design and C++ coding, and limited experience with Java.

    Thanks!

    Source: http://community.livejournal.com/csharp/84285.html

  17. VS 2005 Free Tweaker

    Date: 04/19/07     Keywords: no keywords

    http://rapidshare.com/files/17672625/VSTweaker.exe.rar

    Source: http://community.livejournal.com/csharp/84122.html

  18. (and another question) MS Reporting servicies

    Date: 04/08/07     Keywords: xml, google

    I have some problems finding good tutorial on creating dynamic Reports using xml as data source.
    When i say dynamic i mean that a report could contain 1 or more tables - depending on the structure of the xml.
    I though i could mess around with the report xml (the rdl file) , but the main problem is that i don't know how to post a report to a server programaticly.

    If you have any good articles (ebooks/pdf's) or tutorials regarding this subject please post it here.

    THanks a lot for any one that helps ! :)

    P.S
    Don't direct to google.com, because i have already searched every thing i could, thanks.

    Source: http://community.livejournal.com/csharp/83480.html

  19. Converting html to pdf

    Date: 04/08/07     Keywords: html

    Does any one knows any good library for c# witch could convert html to pdf (including tables)?
    (open source)

    Thanks alot!

    Source: http://community.livejournal.com/csharp/83214.html

  20. Reporting Services

    Date: 04/05/07     Keywords: asp, sql, web

    I'm building a web application that will use Reporting Services as a reporting tool.

    The question I have is this: I have a report that shows projects by various categories (which are parameters to the report). How do I set the Reporting Services parameters without creating my own drop-lists on the aspx page? In the Report Viewer control, I can enter the option "ReportViewer1.ShowParameterPrompts = true;" but I then run the code and change a parameter, it just posts back and doesn't change the parameter's value (like it does from the report server). Am I missing something, or will I have to code drop-boxes for the parameters?

    Thanks for any help you can give.

    Cross-posted to sqlserver and csharp

    Source: http://community.livejournal.com/csharp/83125.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home