How to copy the contents of a String to the clipboard in C#?
If I have some text in a String, how can I copy that to the clipboard so that the user can paste it into another window (e.g. from my application to Notepad)? ...
If I have some text in a String, how can I copy that to the clipboard so that the user can paste it into another window (e.g. from my application to Notepad)? ...
I'm using Lucene.Net's MultiFieldQueryParser to search multiple fields in my documents. I want to find out which field the text was found. For example, my search might look like this: var parser = new MultiFieldQueryParser(new string[] {"question","answer"}, analyzer); var query = parser.Parse(searchphrase); for(int idx=0; idx<hits.Len...
Hi I want to write a batch job in c# that runs a task at a random(ish) interval e.g. every hour +/- 20 mins and if no update is needed, then to wait x2 the last time before running again. What is the best method to do this? ...
I'm looking to see if there is an official enumeration for months in the .net framework. It seems possible to me that there is one, because of how common the use of month is, and because there are other such enumerations in the .net framework. For instance, there is an enumeration for the days in the week, System.DayOfWeek, which inclu...
WPF: How to programmatically create a rectangle/button and make it animate along a curve path? Thank you! ...
I have the following class public class UIControl { public string FName{ get; set; } public HtmlInputCheckBox SelectCheckBox { get; set; } public bool OverrideSelect { get; set; } //Want to throw an ApplicationExceptioh if developer uses this constructor and passes //chkSelect = null public UIControl(string ...
This code fails to actually save any changes: // // POST: /SomeType/Edit/5 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(Guid id, SomeType Model) { db.AttachTo(Model.GetType().Name, Model); db.ApplyPropertyChanges(Model.EntityKey.EntitySetName, Model); db.SaveChanges(); return RedirectToAction("Index"); } ASP...
I'm fooling around trying to learn the ins an outs of LINQ. I want to convert the following query (which is working correctly) from query syntax to method syntax, but I can't seem to get it right. Can anyone show me the correct way to accomplish that? var logQuery = from entry in xDoc.Descendants("logentry") ...
For the moment we're still working with the 2.0 framework and and although 2.0 provides all the necessary we need for the moment, we'll have to move on to 3.5 sooner or later. The other day there was an in house discussion going on whether there is any risk involved in this upgrade, and this risk was not to be taken lightly since all our...
I have received an assembly from a third party. I need to add it to the GAC, but it does not have a strong name. Is there any way for me to sign the assembly using my own key so that it will be strong named? ...
I am writing an application that required the development of an engine for handling data, but the engine had to be replaceable by another depending on the customers' need. Since each customer had very different needs, I wanted to make each engine separated from the others so we could only deliver the application with the engines the cust...
I've used a number of techniques in the past to paint images in Windows.Forms and I'm now revisiting some core libraries that handle rendering skin images for our product. I'm interested in particular in rendering the same image multiple times (tiled) to represent the field of a background control. Assuming the image is exactly the right...
I have a web application on an IBM WAS server (Windows). In the WAS app users are able to browse files on a different server. This functionality connects to a web service in order to retrieve a listing of files from a network path. The web service is built with .net and resides on a separate server which is in the same domain as the f...
Is it good practice to have one shared SqlConnection object in a .NET application to use for all of your database connections or should you have a separate one each time you access the database? I currently have a shared one and seem to be running into issues all of a sudden. It seems like I can't use a shared one when I need to use SQL...
Using the System.IO.Compression namespaces classes GZIPStream and DeflateStream I successfully can compress and decompress individual files. However, if I pass a directoryname as target for compression I get a security exception. Do I have to (recursively) enumerate all files and subdirectories to be able to compress a directory? (Proba...
I want to call a google service using javascript with a keyword and a website url, and get from google the position of this site while searching with this keyword. This is possible? can be done just using javascript or will need a server side language? ...
good evening! currently i'm developing a wpf-client for some rest-service. the communcation with the rest-service is no problem and is done in an extra assembly (communcation-interface). basically: i have a somehow "search"-button which executes a method. this method communicates with the service, updates some textboxes and a progress-...
For some reason my webservice does not like the data I'm sending it. I keep getting the following error: System.InvalidOperationException: Request format is invalid: text/xml; charset=utf-8. at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() ...
I'm trying to connect to a C# HTTP server with an iPhone app. Pretty simple code so far: NSData *requestData = [ NSData dataWithBytes: [ requestMessage UTF8String ] length: [ requestMessage length ] ]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:infoURL]]; [request setValue:@"appl...
One of my websites references a library in my solution called "Foo" That project generates a file called "Foo.dll" and the classes in it are in a namespace called "MyCompany.Foo" so far everything worked out...well I right clicked on project "Foo" and changed the filename it outputs to to be "MyCompany.Foo"....now the project generates ...