|
Hi!
I need to build/utilize a special printer driver.
Say my printer name is XYZ.
If from any Win Application, I print some document on XYZ, the file must be 'copied' to some specified folder.
This is like a File Copy Agent Printer Driver.
Any info whether there is something like this.
Thanks in advance.
malikware
|
|
|
|
|
Depends on the format you want it to be 'copied' as. There are many PDF print drivers that you can programmatically set (usually through the registry) to dump the printed output to a folder as a PDF file. Check out www.PDFmachine.com for one such example.
|
|
|
|
|
I've searched all over, but I cant for the life of me find anywhere that someone has made (or knows how to make) a button with a drop-down arrow, like the button when you use "Add Existing Item" to a project, the Add button has a dropdown.
Infragistics have a UltraDropDownButton that does this, but it doesn't look like a windows button and I can't get it to.
Any tips?
--
Dave
|
|
|
|
|
Run character map and have a look at the Wingdings and Symbol fonts (I think the drop-down arrow that you're looking for is in Webdings 3). Enter the corresponding character in the button's text field, and set the appropriate font. You'd probably want give the button an "action" part for executing the default, and a "drop-down" part that shows your pop-up menu; so do this as two separate buttons. Putting these on a panel would also be a good idea. For the actual pop-up bit, set up a context menu to pop up when the user clicks on the drop-down button.
|
|
|
|
|
Here is an example from a button control that I created. The drop-down arrow is represented by the number 6 in the Marlett font.
<br />
System.Drawing.Graphics g = this.CreateGraphics();<br />
System.Drawing.Font font = new System.Drawing.Font("Marlett", this.Font.Size);<br />
System.Drawing.SizeF sizeF = g.MeasureString("6", font);<br />
<br />
Brush brush = Enabled ? SystemBrushes.ControlText : new SolidBrush(SystemColors.GrayText);<br />
<br />
g.DrawString("6", font, brush, <br />
Width - 4 - sizeF.Width, (Height - sizeF.Height) / 2.0f);<br />
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
From a string like this: "A B C" or "D A C B" (number and order of letters doesn't matter). How can I generate all possible subsets recursively? I've tried everything and I can do it with iteration mode but can't find a pattern to use with recursion!
To:
"A B C":
Generate:
A
B
C
A B
A C
B C
A B C
|
|
|
|
|
This method should do the job:
private void SearchCombinations(string[] splitted, int currentIndex, string resultSoFar, ArrayList results)
{
if (currentIndex >= splitted.Length)
return;
string nextResult = resultSoFar + splitted[currentIndex];
results.Add(nextResult);
SearchCombinations(splitted, currentIndex + 1, nextResult, results);
SearchCombinations(splitted, currentIndex + 1, resultSoFar, results);
}
where the initial call should be something like:
ArrayList results = new ArrayList();
SearchCombinations("A B C D".Split(' '), 0, "", results);
and to make output at the end:
string output = "Combination Count:" + results.Count;
foreach (string s in results)
output += "\n" + s;
Note that this is very memory hungry because all results are stored in memory, but for 26 characters (I tried it with the whole alphabet) it should work (although taking some time because of paging).
|
|
|
|
|
i've added to my application a setup solution.
I've got all the standard form that visual studio made automatically.
If i want handle the main function of the form n°1 or handle the click of the button... how can i do?
|
|
|
|
|
I am creating an ASP.Net web application using C# and want to know how do I display a script message when I enter a page or leave the same page. I have this code in the Page_Load
string alertScript = "<script language=JavaScript>";
alertScript += "alert('" + "Message" +"');";
alertScript += "</script" +">";
if (!IsClientScriptBlockRegistered("alert"))
this.RegisterClientScriptBlock("alert", alertScript);
When I enter the page, the message is displayed, but when I leave the page the message is not displayed. How do I get the message to display when I leave the page? Any help would be appreciated, thanks.
|
|
|
|
|
hi there,
To alert when leaving the page, u have to put a snippet code of JS for page's unload event
<< >>
|
|
|
|
|
How do I use the OnUnload event? Can you give me an example? Thanks.
|
|
|
|
|
|
Thanks for the tip, but I was hoping for something in C# that I can put in the codebehind in my page.aspx.cs file because I need to access items in my HashTable to display in the message.
|
|
|
|
|
Yep, u can do it in C# code-behind.
Play around with RegisterClientScript (I cannot remember exactly)...
<< >>
|
|
|
|
|
Trying to call a method called tester which will loop round 10 times adding 10 to the val variable...any ideas??
public class tester
{
//fields
public int val;
//method
public tester()
{
for(i=0,i<10,i++);
{
val = "+10";
}
{
return val;
}
|
|
|
|
|
|
is there some kind of AntiVirus/Anti Spyware API that i can use from C#. I have a set of files that I would like to check for virses. Is there a way?
|
|
|
|
|
afaik there are no public libraries to do this in any language. The routines used to do so are very complex and are jelously guarded by the handful of companies that have developed them. Just the routines wouldn't do you any good since you'd also need an upto date database as well.
I'd suggest you investigate existing products to see if they accept commandline execution.
|
|
|
|
|
how can i execute a DOS command through C# and trigger an event once the command has finished executing?
Example: How can i run chkdsk and then truger an event when it finishes
|
|
|
|
|
You do this as you would any process, except that you need to wait until it's finished executing (and optionally get the return code):
using System;
using System.Diagnostics;
class Test
{
static int Main()
{
int ret = 0;
Process p = Process.Start("notepad.exe", "newfile.txt");
using (p)
{
p.WaitForExit();
ret = p.ExitCode;
Console.WriteLine("Process exited with {0}", ret);
}
return ret;
}
}
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi there!
I'm trying to implement SMTP client and I'm having a problem:
I'm trying to use remote SMTP (like outlook) so I'm manipulating with MailMessage.Fields:
"http://schemas.microsoft.com/cdo/configuration/sendusing" = 2 - Remote SMTP
"http://schemas.microsoft.com/cdo/configuration/smtpserver" = "smtp.bezeqint.net"; Remote smtp server
"http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = 25 port
and i have all the time the same exception:
"Could not access "CDO.Message" object. Exception has been thrown by the target of an invocation. The SMTP server name is required, and was not in the configuration source".
Please help me!
evgenyus
|
|
|
|
|
Those are only for the Configuration module and won't work on the Message module itself. The MailMessage class in the BCL does not expose the CDO IMessage.Configuration property, however. What you can do is set the static SmtpMail.SmtpServer property, however, before calling SmtpMail.Send .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi.
I need to use extended ASCII in my software to cover all the character. Other encoding(Unicode etc) is not an alternative.
My code is as following:
StreamWriter Tex=new StreamWriter(m3uFileName, true, Encoding.ASCII);
I need to be able to use å ä ö etc characters so I need the extended one.
Any suggestions?
|
|
|
|
|
Hi!
I must admit that I've never heard of an "extended ASCII", but there are a few thing you can try nevertheless.
First, you could use Encoding.Defau lt instead of Encoding.ASCII to get the encoding of the current system codepage.
Or, if you know the exact name of the encoding you want, you can use Encoding.GetEncoding(Name) .
Regards,
mav
|
|
|
|
|
ASCII characters are what they are - 7bit characters using codepage 0x4E9F. You can specify a different ANSI code page using Encoding.GetEncoding to specify a code page that contains the character about 127 you want.
The characters above are in the 1250 code page (Western European) so you could use new StreamWriter(m3uFileName, true, Encoding.GetEncoding(1250)) and specify those characters in source as \xe5, \xe4, \xf6, etc.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|