Hello,
We have an application that basically archives files and we give the user the possibility to print these files. They can be .txt, .doc, .pdf, .jpg nothing fancy.
Is there a .NET way to send these files to the printer without handling them further, ie opening them?
I already tried creating a process with the StartInfo.Verb = "pri...
Hi,
I haven't seen anything explicitly saying this can't be done, but I want to confirm...
We have a client who needs to consume a web service and they are still using .NET 1.1
I would love to use this as a reason to learn some WCF, I just want to make sure it's compatible..
from what I've read, it looks like I can host the WCF servi...
In pre-.NET world I always assumed that int is faster than byte since this is how processor works.
Now it's matter habit of using int even when bytes could work, for example when byte is what is stored in database
Question: How .NET handles byte type versus int from point view of performance/memory.
Update:
Thanks for the input. Unfo...
I have a .NET server application that must store passwords that can't be hashed because some APIs I use need the passwords in plain text.
These passwords can also be exported and imported as part of the system configuration into another server instance of the application or for backup purposes.
The encrypted data will definitely need ...
I need to capture the KeyUp event in my form (to toggle a "full screen mode"). Here's what I'm doing:
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
if (e.KeyCode == Keys.F12) this.ToggleFullScreen();
}
private void ToggleFullScreen()
{
// Snazzy code goes here
}
This works fine, unless a c...
Earlier today I've found a bug in one of our projects - there is a conenction with database that is never closed, i mean the Close() method is never called. However, when I close the application, the connection is closed (checked in sql management studio many times). Why?
...
I have class A which has ISerializable implemented for custom serialization. Now i need to pass around this class A in WCF.
I want to use DataContractSerializer for WCF serialization not my custom serialization.
WCF would not allow it, it does not allow [DataContract] atribute if class has ISerializable implemented.
How can i use Da...
I am looking to implement database like transactions in C#. I am processing multiple XML files. Any particular XML file can call child XML file during processing. The processor will start processing child XML file. If initialization conditions fail or there is an exception, then I want to resume processing parent XML file. This is the re...
When doing Unit Testing, is there a way to tell the [TestClass()] to execute one [TestMethod()] by one? (Instead of Visual Studio to start multiple thread). This would be required for only one or two of my testing classes.
...
I have written a .NET class that converts decimal (money values) to an english readable string.
113.25 => one hundred thirteen and 25 cents.
It is the amount line on checks. The code is deployed and works, but I was wondering if there was a better approach than writing a bunch of if, switch, integer division, and modulus statements. I...
Is there a Win32 function I can call to show a Windows login dialog?
E.g., Internet Explorer and Visual Studio's Team Explorer both show a credentials dialog when accessing a website - how can I show that dialog?
I have a .NET Windows client application that uses the logged in Windows user identity when communicating to web services. T...
I saw in WCF they have the [OperationContract(IsOneWay = true)] attribute. But WCF seems kind of slow and heavy just to do create a nonblocking function. Ideally there would be something like static void nonblocking MethodFoo(){}, but I don't think that exists.
What is the quickest way to create a nonblocking method call in c#?
E.g....
in my output of a grid
i calculate a TimeSpan and take its TotalHours ex. (Eval("WorkedHours") - Eval("BadgedHours")).TotalHours
goal is to show this TotalHours as : 39:44 so. First value 7.5 to 07:30
no problem.. but if its negative!
I can create a TimeSpan object from Hours with TimeSpan.FromHours( (Eval("WorkedHours") - Eval("Ba...
Hi i want to add a datarow that im getting back from a data table to a new datatable
this is the code im using:
foreach (DataRow dr1 in dt.Rows)
{
string AptType = dr1["AppointmentType"].ToString();
if (AptType == "FreeTime")
{
dt2.ImportRow(dr1);
}
}
RadGrid2.DataSource = dt2;
reader.Close();
conn.Close();
the problem i...
I have a toolbar of images, and I want text labels underneath the images. Where the text labels are multiple words, I'd like to stack the words vertically. How can I do it?
...
I'm making some pretty string-manipulation-intensive code in C#.NET and got curious about some Joel Spolsky articles I remembered reading a while back:
http://www.joelonsoftware.com/articles/fog0000000319.html
http://www.joelonsoftware.com/articles/Unicode.html
So, how does .NET do it? Two bytes per char? There ARE some Unicode chars^H...
How to show in the WPF Listview using the GridView an empty text (like in ASP.net), e.g. "please select a person" or "0 items founded"?
...
I have an application that sends out many PDF's to a printer. Has anyone had any experience creating a Mock object that represents a local printer?
...
I’ve been trying to find a way to extend SharePoint breadcrumbs across multiple site collections, and I’ve been unable to find a way. I can set the portal site connection setting on the site collection to link to its parent site collection. But, that will not show only one parent site collection. Here’s an example of the type of setup...
I have 3 similar functions, that only change based on numeric type:
<Extension()> _
Public Function ToNullableShort(ByVal str As String) As Short?
Dim intReturn As Short
If Short.TryParse(str, intReturn) Then
Return intReturn
Else
Return Nothing
End If
End Function
<Extension()> _
Public Function ToNulla...