|
I created a class library project dll , i wanted to add this dll in the windows/assembly folder for the purpose of making it public assembly.
For that , i created a strongname key file , then i added that file information in the assembly file of the classs library project dll.and afterwards i build the project and finally i wrote the following syntax
gacutil -i "dll path"
this added the dll in the assembly folder.
now whenever i try to add the reference of the dll in the new project
should i get my dll (which is now in the assembly folder) in the dialog box of add reference .
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Pankaj Garg wrote: now whenever i try to add the reference of the dll in the new project
should i get my dll (which is now in the assembly folder) in the dialog box of add reference .
Yes.
|
|
|
|
|
If it is deployed to GAC, you will get it in the add reference window.
|
|
|
|
|
Pankaj Garg wrote: in the dialog box of add reference
I always use the Browse or Projects tab to get the DLLs I write, whether in the GAC or not.
|
|
|
|
|
Hi,
I need to develop an applicaion to control over printer,
It should support-
Print Test Page
Get User name
Get IP Address / system name
Get Printer status
Current Printed page count
Toner Status etc.
Is this possible to develop this application using Printer Job Language (PJL) ?
your quick help is appreciated.
Thanks.
Sunil
|
|
|
|
|
Funny how everyone wants to do PJL all of a sudden...
|
|
|
|
|
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();
}
}
|
|
|
|