|
Hi.
I have a question regarding setting printer properties programmatically.
Here's what needs to be done.
I need to set properties of the Ricoh multi-function printer to have default color set to 'black & white' when user logs into the machine (printer is on a network).
The problem I have I don't know if it's possible. If it is, and the program/script can be created I will call it from a batch file, which runs every time user logs in.
Is there anyway I can use .NET languages (or any other) to set Color to 'black & white' by default for that printer. We are trying to eliminate color printing especially when it's not needed.
Thank you.
|
|
|
|
|
It is possible - there is a windows API call (Setprinter) that can be coded to set that setting, but I don't see how you can prevent the user just going to printer settings and switching it back to colour...?
|
|
|
|
|
Users are remotly connected so they can't go to the printer.
Do you have any examples of that API?
I appriciate your respose.
Thank you,
|
|
|
|
|
I have added this to the very latest code of the PrintQueueWatch component - it will be in the new release whenever the project gets updated here[^]
e.g.
Dim MyPrinter As New PrinterQueueWatch.PrinterInformation("HP Laserjet 2")
MyPrinter.Colour = False
|
|
|
|
|
How to generate a Stored Procedure Reporting in Visio.
I tried using the Database Model Diagram, created a Datasource & selected a Stored Procedure.
It showed empty results.
Please let me know what is the use of it?
Jassbond
Persistent Systems, Pune
9890596778
|
|
|
|
|
I want to turn off
computer in my pograming
how i can do this
have a nice day/
|
|
|
|
|
|
Vega02 wrote: Redirecting to C# forum
Why? There is nothing in the C# language that will do this. However there may be stuff in the .NET Framework that might so I'd say this forum is a valid place to put this question.
|
|
|
|
|
Oh... I see - The OP cross posted to the C# forum where you had already answered the question. Why didn't you say that? It looks like you are saying the C# forum was a better place for the question.
|
|
|
|
|
Colin Angus Mackay wrote: Oh... I see - The OP cross posted to the C# forum where you had already answered the question. Why didn't you say that? It looks like you are saying the C# forum was a better place for the question.
No, you're right. I was just trying to redirect all follow-up comments to the other thread in the C# forum to keep them consolidated, but I was working too quickly and didn't clarify that point. Apparently that didn't work out as well as I'd hoped.
|
|
|
|
|
C# code:
System.Diagnostics.Process.Start("ShutDown", "/s");
/s for ShutDown
System.Diagnostics.Process.Start("ShutDown", "/r");
/r for Restart
System.Diagnostics.Process.Start("ShutDown", "/l");
/l for LogOff
Srinivas Jadhav
Mb: 9890596778
|
|
|
|
|
I create an activities for Windows Workflow Foundation, which cannot be serialized. Workflow can begin serialization automatically and therefore I'll get runtime error.
If you know how to prevent automatically serialization of workflow or something else to solve this issue, PLEASE WRITE.
Vorskla.
|
|
|
|
|
hi guys,,, i have a dll based on Pascal sentecnce,, but i want to use this dll in my charp code, how can i do that,, do i need to convert it into c# code syntex related dll , i dont have any idea,,
plz help me
thanks in advance
here it is one example of one of its functiomn which i want to access
LONG PASCAL OpenDoor(LPCSTR DevNo,BYTE CtrNo)
hello
|
|
|
|
|
Hi,
haven't used Pascal so far. Is this library COM enabled? If yes then you can just add a reference to it - Visual Studio will automatically create a managed wrapper for it. Otherwise read about DllImport which might also help.
Robert
|
|
|
|
|
no its not a com enabled library ,,,,
thanks
hello
|
|
|
|
|
Hi guys,
I have built a custom Installaion project for one of my programs. I
have included in it some code that registers the product. This
registration code is in a seperate DLL file which gets executed. The
DLL has got a window form interface with a few options ("Demo",
"Activate", "Exit"). The problem is that if you click "Exit" I get the
following error message:
Could not find file "c:\proramfiles\company name\application
name\applicationname.InstallState".
If I click on the "Activate" Button it takes me through the activation
process sucessfully but upon going back to the installer it pops up the
same error message above.
I hope somebody can help here.
Thanks
|
|
|
|
|
I want to return a System.DateTime object from a method and be called when its value is chagned without keeping a reference to it.
For example
class SomeClass
{
public System.DateTime Field
{
get
{
return new System.DateTime(); //I want to know when the value of this object changes
}
}
}
|
|
|
|
|
System.DateTime just returns the current system time when executed. It does not get asynchronously updated by the system.
Geo
|
|
|
|
|
I think I didnt explain it very well
The DateTime will be populated with a value by the calling code. I want the class that returned the DateTime object to know when that happens.
|
|
|
|
|
|
George L. Jackson wrote: Use an event (delegate).
Please excuse my stupidity but how do I actually do that? Can I make an event fire when the value of the datetime object changes?
|
|
|
|
|
Hi,
first of all DateTime is a structure. This means that you don't pass around a real reference but a copy of the structure.
In your case you will probably need a small wrapper class for your DateTime:
public class MyDateTime {
private DateTime _value;
public event EventHandler ValueChanged;
public MyDateTime(DateTime value) {
_value = value;
}
public DateTime Value {
get { return _value; }
set {
_value = value;
OnValueChanged(EventArgs.Empty);
}
}
protected virtual void OnValueChanged(EventArgs ea) {
if (ValueChanged != null)
ValueChanged(this, ea);
}
}
Now whenever someone sets the Value property to a different value the ValueChanged event will be raised.
Your class should then look something like that:
class SomeClass
{
public MyDateTime Field
{
get
{
MyDateTime result = new MyDateTime(new System.DateTime());
result.ValueChanged += new EventHandler(OnFieldValueChanged);
return result;
}
}
private void OnFieldValueChanged(object sender, EventArgs ea) {
}
}
Depending on what you do it might also be necessary to unbind the event at some point. This would also depend on the fact if you really create a new instance of your DateTime on every get on the Field property. Probably something like this is better:
class SomeClass : IDisposable
{
private MyDateTime _field;
public SomeClass() {
_field = new MyDateTime(new System.DateTime());
_field.ValueChanged += new EventHandler(OnFieldValueChanged);
}
public MyDateTime Field
{
get { return _field; }
}
public void Dispose() {
_field.ValueChanged -= new EventHandler(OnFieldValueChanged);
}
private void OnFieldValueChanged(object sender, EventArgs ea) {
}
}
Robert
|
|
|
|
|
|
Hi Robert,
Thanks for your reply. I had thought of doing it this way but the problem is if the user of this code does the following
SomeClass c = new SomeClass();
MyDateTime t = c.Field;
t.Value.AddDays(2);
The event will not fire.
If they do this it would be ok
t.Value = t.Value.AddDays(2);
but I cant enforce this because I cant make the get() return a const
|
|
|
|
|
Looking more closly at the doco there is no method on DateTime that will change its value. The methods that modify the value return a new structure. Our programmers are just going to have to learn to code
someObj.Timestamp = someObj.Timestamp.AddDays()
I really really miss C++'s const-ness
|
|
|
|