.net

How can I stream a .net chart as a PNG? (Parameter is not valid)

I have a generic handler in vb.net that builds a chart and then returns a png as a result. Relevant code on /GetChart.ashx (which is actually called as /GetChart.ashx?report=1): AssetChart.RenderType = RenderType.BinaryStreaming Dim mstream As New MemoryStream() AssetChart.SaveImage(mstream, ChartImageFormat.Png) Dim byteArray As Byte...

How do I "Change the Value of a Setting Between Application Sessions" in a C# application?

The MSDN web page makes it sound easy to change application settings by hand. I can't find the file though. I can find the file in my development path, but I have no idea if that is the path the application is actually running in. I set a DB connection setting in "settings.settings" and now I want to change it on my machine. I unders...

Loaded Entity not being passed back

Hi all, This is probably a complete noobie error. My deepload is loading my related entitied fine and T Entity is correctly populated, but when I go back to the original call it hasnt kept the updates? Now I'm sure EntityObjects are reference types (stupid question, but im doubting myself here) So I shouldnt need to pass it back. he...

Url encoded characters, ViewState and byte[] arrays oh my...

I am trying to throw together a screen scraper and keep getting invalid viewstate issues. It appears that during the System.Net.WebClient download of data or the System.Text.UTF8Encoding.Default.GetString call to convert the byte array returned by the WebClient DownloadData call to a string - that strings which match url character codes ...

Sending fax using Windows Fax Server Extentions - faxcomexlib

I'm trying to find faxcomexlib.dll. After Googling around, I installed the Core SDK from the Platform SDK, but I still don't see this dll listed in the System32 folder. This is the code I'm trying to run: FAXCOMEXLib.FaxServer faxServer = new FAXCOMEXLib.FaxServerClass(); //faxServer.Connect(Environment.MachineName); ...

C# Private/Public Encryption using AES

I am trying to figure out how to make public/private keys that are AES encrypted. I'd like to be able to use it like so: byte[] BytesToEncrypt = { 0x01, 0x02, 0x03, 0x04, 0x05 }; byte[] PublicKey; byte[] PrivateKey; byte[] EncryptedBytes; byte[] UnencryptedBytes; PrivateKey = CreatePrivateKey(); PublicKey = CreatePublicKey(PrivateKey);...

RadEditor UploadPaths Absolute File Paths

I am trying to set the uploadpaths for all of the RadEditor File Managers to the same absolute file path, and also share the same path across a couple of Solutions on the same machine. So, I wrote a method to get the path from the Web.Config and set all the Properties on the FileManagerDialogConfiguration objects (UploadPaths, ViewPaths...

i need a .net library that will transcode an audio file from amr to pcm

i need a .net library that will transcode an audio file from amr to pcm. I would prefer not to call a program from the command line, but I am desperate. ...

How to DataBind to specific item properties in an ItemsControl in the most elegant way?

Scenario: A ListView is DataBound to an ObservableCollection<CustomClass> and is displaying it's items through a custom ItemTemplate. The CustomClass just contains three string properties and one boolean property and already has INotifyPropertyChanged implemented on every of it's four properties. The custom ItemTemplate of the ListView h...

How can I get the DOS path name of a running process in C# / Win32?

To sum it up, I need to do this: 12345(hWnd) -> "C:\setup.exe" Right now, I am using GetProcessImageFileName to retrieve the Kernel Device Path of a process handle. I'm retrieving the handle using OpenProcess, passing it the PID. The PID (which I also need) is being retrieved using GetWindowThreadProcessId. However, this gets ...

How do you map a Dto to an existing object instance with nested objects using AutoMapper?

I have the following Dto and entity with a nested sub entity. public class Dto { public string Property { get; set; } public string SubProperty { get; set; } } public class Entity { public string Property { get; set; } public SubEntity Sub { get; set; } } public class SubEntity { public string SubProperty { get; se...

Reuse existing types not working for silverlight

I have two web services that return the same type. It doesn't work... it generated proxies for each and sees them as two different types. What are the typical causes for this? Do I need to be using WCF for this to work? ...

Async Function Thread.Sleep in Web Application

Hey All, I maintain a ASP.NET web application that causes a user's network connection to reset for several seconds when it executes a procedure. Therefore, the page request times out on the user's end as they never receive the web application's response (the connection dies before it gets the response packet). To resolve this situat...

Reading from Excel: Microsoft.Jet.OLEDB.4.0 error on 64 bit systems

I am reading the contents of an excel sheet in my application using: OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Extended Properties=Excel 8.0"); _myDataSet = new DataSet(); OleDbDataAdapter myCommand = new OleDbDataAdapter(" SELECT * FROM [" + "My Sheet" + "$]", con); myC...

Use Mono.NET Library in Linux

First of all, I'd like to point out that I have no experience using Mono.NET, so bear with me if the questions are silly. I'm working on an application that is written in native C++ code and works in Windows (VS2008) and Linux/Mac (gcc). There is a library that I am looking to integrate with, which is currently compiled in MS.NET (versi...

Setting up a OpenID provider for testing

I'm developing a site that uses OpenID for authentication, which is working fine however... I often work on it while travelling without an internet connection. If the session expires and I need to login again, I can't until I have connectivity again. What I'd like to do is setup a really dumb OpenID provider on a local IIS, that I can ...

What property in a font file makes a program decide to simulate bold?

I am looking for a property in a font file (either from WPF's System.Windows.Media.Fonts Typeface or GlyphTypeface) or directly accessing the .ttf/.otf file that will allow me to determine if a program like Write/WordPad in Windows will apply Bold to the font. Basically, some fonts that have the Bold attribute will still get an extra bol...

Why is one of my ScrollViewer commands not working in ListBox template?

Got a weird problem here. I have created a template for a ListBox based on the standard template (i.e. I have not changed anything other than what I indicate below). I am trying to add a couple of buttons to the side of the template so that I can scroll the ScrollViewer (which is part of the standard ListBox template) left and right. Th...

ClickOnce problem - will not run from menu shortcut

Tried to create a ClickOnce install. Inside internal network. It runs once after Setup (automatically). Then when run from menu item it does not run. Closer examination in Task manager reveals its in there as a "process" (not application), but not visible. If you update ("publish") the app again it will run once from the menu shortcut, ...

How do you convert between the different types of .Net System.Web.UI.WebControls.Unit?

You create a WebControl with a specified width. In it, there are 3 parts. The left part must be left-justified and has its own width. The right part must be right-justified and has its own width. The final middle part must take up the remaining width and must get its width from the other 3 widths. Since the widths must be specified ...