In implementing a basic Scheme interpreter in C# I discovered, to my horror, the following problem:
IEnumerator doesn't have a clone method! (or more precisely, IEnumerable can't provide me with a "cloneable" enumerator).
What I'd like:
interface IEnumerator<T>
{
bool MoveNext();
T Current { get; }
void Reset();
// NEW...
Is there a way to launch a C# application with the following features?
It determines by command-line parameters whether it is a windowed or console app
It doesn't show a console when it is asked to be windowed and doesn't show a GUI window when it is running from the console.
For example, myapp.exe /help would output to stdout on the...
I have two ListBoxes, lstAvailableColors and lstSelectedColors. Between each listbox are two buttons, Add and Remove. When a color or colors is selected in lstAvailableColors and the Add button is clicked, I want to remove them from lstAvailableColors and display them in lstSelectedColors. Also, if colors are selected in lstSelectedCo...
I'm getting "Reentrancy was detected" MDA error while setting a webbrowser control's properties.
This only happens if I call "SetWindowsHookEx" to hook some dials within the same thread.
Normally this hooking code works fine but it doesn't play nice with Webbrowser Control. When I ignore the exception code works fine, at least look like...
I asked a question in which one of the response contained the following LINQ code:
var selected = lstAvailableColors.Cast<ListItem>().Where(i => i.Selected).ToList();
selected.ForEach( x => { lstSelectedColors.Items.Add(x); });
selected.ForEach( x => { lstAvailableColors.Items.Remove(x);});
Can someone explain the above LINQ to a tota...
Hi!
I am new to .NET and have a problem. I have an app that creates a security token to use remote web services. When I run the app locally on my machine it works fine (in the Visual Web Developer Express 2008). I then took a shared hosting Windows account on godaddy.com. When I publish the site and then check online, I get the error:
...
Hi,
These lines cause a security exception in a godaddy account. Any suggestions how to rewrite to get this to work?
File.Delete(PropsFileName); // Clean up
TextWriter tw = new StreamWriter(PropsFileName); // Create & open the file
tw.WriteLine(DateTime.Now); // Write the date for reference
tw.WriteLine(TokenLine); // Write t...
Hi everyone, I would like to know the best method for solving this problem:
I would like to create a blank template xml from a xml schema. All the required elements and attributes would be created and their values would be all empty strings.
The next step is how to determine which child xml nodes a certain node could have. eg. I would s...
I have a GridView that is bound with a dataset. I have my footer, whichis separated by the column lines. I want to merge 2 columns; how do I do that?
<asp:TemplateField HeaderText="Name" SortExpression="Name">
<ItemTemplate>
...
</ItemTemplate>
<FooterTemplate >
Grand Total:
</div>
</FooterTemplate>
</asp:Templat...
Can you recommend a library for .NET that can receive FAXes? Window Fax server is not enough - need to auto process and route the Fax once it is received based on the incoming Caller ID.
...
Background: I need to provide a weekly report package for my sales staff. This package contains several (5-10) crystal reports.
Problem:
I would like to allow a user to run all reports and also just run a single report. I was thinking I could do this by creating the reports and then doing:
List<ReportClass> reports = new List<ReportCla...
I was learning python using the tutorial that comes with the standard python installation. One of the benefits that the author states about python is "maybe you’ve written a program that could use an extension language, and you don’t want to design and implement a whole new language for your application" - My question is how would i go a...
I've created two classes, with one of them having an implicit cast between them:
public class Class1
{
public int Test1;
}
public class Class2
{
public int Test2;
public static implicit operator Class1(Class2 item)
{
return new Class1{Test1 = item.Test2};
}
}
When I create a new list of one type and try t...
Does anyone have some code that will take a TimeZoneInfo field from .NET and execute the interop code to set the system time zone via SetTimeZoneInformation? I realize that it's basically mapping the TimeZoneInfo members to the struct members, but it does not appear obvious to me how the fields will map exactly or what I should care abou...
I've got some sql returning a decimal(20,0) data type. In SSIS I have a package with a foreach loop. In my variable mappings, what type of variable would I map it to? I've tried Int32, Int64, double, and still get the error "The type of the value being assigned to variable "User::iID" differs from the current variable type..."
...
I created an image-viewing control for my boss that incorporates panning, zooming via the mouse wheel, and drawing a box to zoom to. The control needs to support very large image files (i.e. several thousand pixels on each side).
It all works, but whenever the code is scaling the image the control UI becomes unresponsive. My boss had ...
Maybe I'm just an idiot, but I can't seem to find an event that will fire for a textbox at the same time as the leave, but only when the contents of the textbox has changed. Kinda like a combination of textchanged and leave. I can't use textchanged cause it fires on each keystroke. Right now I'm storing the current value of the textbo...
Using .NET's DbConnection.GetSchema(), how do I find the owner of a given database?
Alternatively, if you have another solution that is not coupled to a specific impelementation of SQL, I'd like to hear that as well.
...
I'm running string.Format on a readonly string that contains a bit of HTML + javascript but I get a System.FormatException instead.
This is my format string:
<script type="text/javascript">
function {0}_showHideFieldWindow() {
if ({0}.IsCustomizationWindowVisible()) {
{0}.HideCustomizationWindow();
} els...
I need to come up with a smarter/simpler way of doing ajax calls in our current .net webforms app. I know jQuery basics and I like it alot. I'm thinking of proposing to my team the use of jQuery to directly call .net Page Methods as described here.
Does anyone know of any problems/limitations with this approach? Is there a simpler w...