|
Hi
I would like to develop an application for printer using Printer Job Language .I am new in this domain. So, I would like to know that answers of the following questions.
1. Can I develop this application in C# using PJL
2. If yes, then how can I send command to printer and how can I get response?
3. Is Hp p2015 printer support PJL?
Please send me any fruitful link or reference so that I can easily develop this application
Regards
Rajesh
rajesh
|
|
|
|
|
When you found the answers for question 2 and 3, come back to ask your C# question.
|
|
|
|
|
Hi,
I want to read entries from event log , I also developed that application but my requirement is that if i have to get log of only those entries which i specify between two dates. So for that i have to read all entries , and check whether that entry falls in that particular date range but it is very slow process , i want some faster logic for example if i give a date it directly jumps into that date entry and give me the details.
regards
modified on Wednesday, July 9, 2008 1:07 AM
|
|
|
|
|
While not specific to your problem, I have noticed some new classes in .NET 3.5 in the System.Core.dll, specifically System.Diagnostics.Eventing.Reader namespace. That may or may not be of some help
|
|
|
|
|
System.Data.SqlClient.SqlException was unhandled
Message="An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
can any ne help me to handle this exceptionplease.
i'm not ale to connect sql server
diggudg
|
|
|
|
|
diggudg wrote: this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections
Enable remote connection in SQL Surface Area Configuration Tool
|
|
|
|
|
your firewall might be blocking it
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
hello
i'm a begginer, and developing a databse(MS sql) driven application in visual c# and i have to veify userid and password through connecting database and extracting information from user table.
i'm getting any ideas how to do this please any one can help.
with warm regard
diggudg
|
|
|
|
|
It's trivial. Create connection using SQLConnection class. Create command using SQLCommand instance, execute the query using SQLCommand.ExecuteReader() .
|
|
|
|
|
Use Integrated Security. If they can connect to the database, they're OK.
|
|
|
|
|
Hi everyone, I have a problem on redirecting standard input to another file stream. Using cmd.exe , I could simply run a program like this program.exe < textFile.txt . Using this, when I use Console.ReadLine() it reads a line in my text file. But I need to run the program in other C# application, so I used Process.Start() for this. Having a ProcessStartInfo with FileName = "program.exe" and Arguments = "< textFile.txt" . But using this, it just passes the arguments as strings, not redirecting the standard input to the specified file. Is there a way so that it won't be parsed as a string? Or another way to redirect the standard input?
Thanks.
|
|
|
|
|
|
Thanks for the reply. I tried using it but Process.StandardInput is read-only. So I have to use Process.StandardInput.Write(File.ReadAllText("textFile.txt")) . Assuming textFile.txt is a very big file, it uses up big memory when reading the contents of the text file. I wanted StandardInput be set to another stream just like Console.SetIn() . Is it possible or is there a better way?
|
|
|
|
|
Why not just take the filename as a parameter?
|
|
|
|
|
The program to which I call was made by another person and I don't have its source code. I do not have any means of changing how the parameters are passed.
|
|
|
|
|
In that case, it might be better to just write the complete file as byte[] in contrast to a string, it should help reduce memory and gain a little speed.
|
|
|
|
|
Ok thanks! Will do! I'll read and write it to the StandardInput as a byte array. Thanks again.
|
|
|
|
|
The following is an example of delegates and events I found in a book with a few modifications. I am having trouble trying to make the program work using Delegates, I am trying to insert a message from one class to another classes ListBox. Please help before the reactor goes critical. I’d appreciate any help, please be specific.
Do All Delegates need to be instantiated in the Main menu as every example I see does.
Thanks,
Michael
namespace ReactorDelegates
{
// Declaration of Delegate
public delegate void DelegateReactorMessage(String message);
public delegate void DelegatebuttonStart_Click(object sender, EventArgs e);
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Reactor myReactor = new Reactor();
//ReactorMonitor myReactorMonitor = new ReactorMonitor(myReactor);
//FormReactor FR = new FormReactor();
//FormStartReactor FSR = new FormStartReactor();
Application.Run(new FormStartReactor());
//new FormReactor(),
// Instantiation of Delegate
//DelegateReactorMessage delegateReactorMessage = new DelegateReactorMessage(FR.ReactorMessage);
//DelegatebuttonStart_Click delegatebuttonStart_Click = new DelegatebuttonStart_Click(FSR.buttonStart_Click);
}
}
}
namespace ReactorDelegates
{
public partial class FormStartReactor : Form
{
static FormReactor FR = new FormReactor();
DelegateReactorMessage delegateReactorMessage = new DelegateReactorMessage(FR.ReactorMessage);
String message;
public FormStartReactor()
{
InitializeComponent();
}
public void buttonStart_Click(object sender, EventArgs e)
{
FormReactor FR = new FormReactor();
Reactor myReactor = new Reactor();
ReactorMonitor myReactorMonitor = new ReactorMonitor(myReactor);
reactorToolStripMenuItem_Click(sender, e);
// Set myReactor to 100 degrees Celcius
message = "Setting reactor temperature to 100 degrees Celcius";
delegateReactorMessage(message);
myReactor.Temperature = 100;
// Set myReactor to 500 degrees Celcius
message = "Setting reactor temperature to 1500 degrees Celcius";
delegateReactorMessage(message);
myReactor.Temperature = 1500;
// Set myReactor to 2000 degrees Celcius
message = "Setting reactor temperature to 3000 degrees Celcius";
delegateReactorMessage(message);
myReactor.Temperature = 3000;
}
private void reactorToolStripMenuItem_Click(object sender, EventArgs e)
{
FormReactor mdiChildForm = new FormReactor();
mdiChildForm.MdiParent = this;
mdiChildForm.Show();
}
}
}
namespace ReactorDelegates
{
public partial class FormReactor : Form
{
//static Reactor myReactor = new Reactor();
//ReactorMonitor myReactorMonitor = new ReactorMonitor(myReactor);
//static FormStartReactor FSR = new FormStartReactor();
//DelegatebuttonStart_Click delegatebuttonStart_Click = new DelegatebuttonStart_Click(FSR.buttonStart_Click);
public FormReactor()
{
InitializeComponent();
this.listBoxReactor.Items.Clear();
this.listBoxReactor.Items.AddRange(new object[] {"Reactor down"});
}
public void ReactorMessage(String message)
{
this.listBoxReactor.BeginUpdate();
this.listBoxReactor.Items.Add(message);
this.listBoxReactor.EndUpdate();
}
private void buttonBegin_Click(object sender, EventArgs e)
{
String startMessage = "Start Reactor";
ReactorMessage(startMessage);
//delegatebuttonStart_Click(sender, e);
}
}
}
namespace ReactorDelegates
{
class ReactorMonitor
{
static FormReactor FR = new FormReactor();
DelegateReactorMessage delegateReactorMessage = new DelegateReactorMessage(FR.ReactorMessage);
public ReactorMonitor(Reactor myReactor)
{
myReactor.OnMeltdown += new Reactor.MeltdownHandler(DisplayMessage);
}
public void DisplayMessage(Object myReactor, MeltdownEventArgs myMEA)
{
FormReactor FR = new FormReactor();
String message = myMEA.Message;
delegateReactorMessage(message);
}
}
}
namespace ReactorDelegates
{
class Reactor
{
Int32 temperature;
String strReactorMessage;
public delegate void MeltdownHandler(Object reactor, MeltdownEventArgs myMEA);
public event MeltdownHandler OnMeltdown;
public Int32 Temperature
{
set
{
temperature = value;
if (temperature > 1000)
{
if (temperature < 2000)
{
strReactorMessage = "Reactor meltdown in progress";
}
else
{
strReactorMessage = "The reactor is critical, YOU ARE DEAD, DEAD, DEAD";
}
MeltdownEventArgs myMEA = new MeltdownEventArgs(strReactorMessage);
OnMeltdown(this, myMEA);
}
}
}
}
}
namespace ReactorDelegates
{
class MeltdownEventArgs : EventArgs
{
String message;
public MeltdownEventArgs(String message)
{
this.message = message;
}
public String Message
{
get
{
return message;
}
}
}
}
|
|
|
|
|
MAW30 wrote: Do All Delegates need to be instantiated in the Main menu
No. Delegates can be declared in classes or in namespaces.
FWIW, in the latest version of .NET, you don't really need to define your own delegates anymore because of System.Func and System.Action . For example, you can replace your DelegateReactorMessage with Action<string></string> :
Old code:
public delegate void DelegateReactorMessage(String message);
...
public partial class FormStartReactor : Form
{
static FormReactor FR = new FormReactor();
DelegateReactorMessage delegateReactorMessage = new DelegateReactorMessage(FR.ReactorMessage);
string message;
public FormStartReactor()
{
InitializeComponent();
}
}
New code:
public partial class FormStartReactor : Form
{
static FormReactor FR = new FormReactor();
Action<string> delegateReactorMessage = FR.ReactorMessage;
string message;
public FormStartReactor()
{
InitializeComponent();
}
}
|
|
|
|
|
Thanks, I appreciate the help but do you know why my example doesn't work and how I can fix the problem.
|
|
|
|
|
I tried to execute your code. But it is not complete. If you need someone to try it, post full code. Your code lacks InitializeComponent method.
|
|
|
|
|
I have been building a program for some time now. And now I´m intrested in how to get paid for my application. I will put it out on the internet and make people be able to drive the program for a trial period. I wonder which different ways there is to get paid? I want that the customer automaticly recieve a activation code to the application after they have paid... Please give me some hints to solve this.
Best Regards
Sebastian
|
|
|
|
|
Communicating, more descriptively than your subject line here, with your potential clients would be a good start.
Dave
|
|
|
|
|
Well, 'hi' is not really a helpful subject line. Instead of attracting people who know about your issue, you attract people who are inclined to express frustration at your communication skills.
Most people worry too much about security. Your app is C#, it can be decompiled. Worry a bit, but don't inconvenience people who want to pay you, they will hate you for it.
It's really hard to help you without knowing what the app is. If you can't afford to buy advertising somewhere like CP, and if you can't direct market your app, you're going to enter a world of shareware sites where I would expect a limited return. Of course, advertising on CP only makes sense if it's a developer tool, but it needs to be advertised *somewhere*. Even if you just put together a website and buy google ads.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Christian Graus wrote: communication skills
Seems like people sure don't understand how important that can be.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|