I wrote a method to crop images in C#. It does it by creating a new Bitmap and drawing onto it a specified rectangle (the area to be cropped) from the original image.
For the images I've tried with it was generating wrong results. The size of the resulting image was right, but the content was it. It was like if the image has been scaled...
I have a library project that has some content files (e.g., XML and schema files, image files, etc.) all with Build Action set to Content (copy always).
This library project lives in a Visual Studio solution that also has a test application (WPF) that references the library.
When I build the solution, all the content files from the dep...
Hi folks,
I have a simple POCO class that contains the student's scores.
eg.
Math - 83%
Engrish - 82%
Chemistry - 81%
Drama - 100%
etc..
Is there a way (using linq?) that i could figure out the top 3 properties ordered by score?
I'm assuming the final object will be an IList of an anonymous type, which will have two fields.
Name (t...
It seems that sgen.exe could not generate generic type XmlSerializer, right?
My genereic type:
[Serializable]
[XmlRoot(ElementName = "Masterx")]
public class Masterx<T> where T : class, new()
{....}
Serializer code:
protected virtual List<T> ParseXMLToObject<T>(string resultXML) where T : class, new()
{
//return ParseXM...
I am developing a client-server application - the server being an ASP .NET web app.
The client (a desktop app) needs to send data contained in a text file to my asp .net web app.
Data would be approximately 100 KB, in multi-line textual form.
What is the best approach to POST this data to the server, given that I need to do it once eve...
Hello,
How can I use Opengl in PictureBox toolbox in Visual C++.I didn't come across any document on internet.Do you know any document,tutorial,code example etc. about this topic?
Could you help me please?
...
Hi,
I have the following list of slide objects. Based on the value of object's 'type' var I want to upcast the Slide object in the list. Is it possible?
foreach(Slide slide in slidePack.slides)
{
if(slide.type == SlideType.SECTION_MARKER)
{
//upcast Slide to Section
}
}
...
I've been trying to get the XMLDSIG support in .NET to behave properly, more specifically the SignedXml class. I'm implementing a third party service and they've just recently started requiring that all messages have to be digitally signed...
My problem is that, I can't seem to generate valid signatures. Both the third party service, an...
I have this code:
using ( var site = new SPSite( myUrl ) ) {
using ( var web = site.AllWebs[0] ) {
// read-only operations
}
}
The "myUrl" is top domain url with WSS 3.0. The authentication is set to Windows.
If I run this code from command-line under "external_app_user" account, all is fine. But if I run this code from w...
I have a class which logs to a file .this class is used by multiple threads.
I have use a mutex inside the write function and it works fine with one instance of my application .
but if I start multiple instance of the application the it crashs.
what is the correct implementation of named mutex at class level that can work across proce...
I'm using DES encryption, and I want to store the key of TripleDESCryptoServiceProvider.
But the key consists of (Key + IV),
I was trying to save them in an XML file using
XmlTextWriter
Convert.ToBase64String(...)
but there was an exception due to IV contains invalid characters "=" in XML.
Is there a better way to store symmetri...
Dear ladies and sirs.
I am interesting in understanding the reasons for the following FCE, always happening once when I run the unit tests of our application.
Note, that I wish to understand the reasons and fix the root cause, if possible.
The line causing the FCE:
if (System.Windows.Application.Current != null)
Exception details:...
I'm just beginning to evaluate mocking frameworks for my team and am wondering if anyone has any pointers to reference documentation or experience that you can share regarding the cost of mocking when doing performance tests.
Links? Personal experience? Details appreciated.
...
We have a .NET 2 SOAP web service meant for consumption by another app that is internal to our organisation. The web service returns a .NET dataset like so:
public System.Data.DataSet GetStatementFor(string contractList,
System.DateTime startDate, System.DateTime endDate)
Now in one of the use cases it is necessary to get to the Dat...
How do you call an SSIS package using a Web Application? I'm using SQL Server 2005. I prefer a solution in C#2.0 above. Any help will be greatly appreciated. Thanks in advance.
...
I have a check box in an asp.net webpage
How to fill the labek name of the check box from an xml file ?
I did the same for dropdown but i want similar to checkbox
xmlData.ReadXml(Server.MapPath("./App_Data/view1_" + txt_dropDownToLoad + ".xml"))
DropDownName.DataSource = xmlData
DropDownName.DataValueField = "ddl_cod"
DropDownName.D...
Is there any better way for converting code written in .net framework 1.1 to framework 2.0 rather than manually checking entire application and changing individually
...
Is it possible for a ASPX view (in ASP.NET MVC) to have non-default constructor AND use this constructor when creating this view?
Example - Page will inherit from this class:
public class ViewPageWithHelper<TModel> : System.Web.Mvc.ViewPage<TModel> where TModel : class
{
public ViewPageWithHelper(Helpers helpers)
{
...
I have two access databases and would like to find a way to copy tables from one
database to the other. The copied table has to keep the same strucure and data.
I already tried to fiddle around with sqlBulkcopy but all information i can found about it
is using sqlBulkCopy to tranfer tables to sql server.
Can I use sqlBulkCopy to copy t...
Hello everyone,
I am using C# + VSTS2008 + .Net 3.0. I have an input as a string array. And I need to output the unique strings of the array. Any ideas how to implement this efficiently?
For example, I have input {"abc", "abcd", "abcd"}, the output I want to be is {"abc", "abcd"}.
thanks in avdance,
George
...