|
hi,
I am working on a door lock system. i want to read data from each reader.
if coming data is valid card no. then i have to give 'Gy'[G is address of reader] command to that particular reader. i am using axWinsock1 component and using timer control to read data from
reader . it continuously reading from 'G' reader.
private void timer1_Tick(object sender, EventArgs e)
{
lbl_time.Text = System.DateTime.Now.ToString();
try
{
string cmd = "G0";
byte[] msg = Encoding.ASCII.GetBytes(cmd.ToString());
axWinsock1.SendData(msg);
Object objData = new System.Object();
axWinsock1.GetData(ref objData, 8, 1024);
string strData = (string)objData;
if (strData.Trim() != "0")
{
timer1.Enabled = false;
txtDataRx.Text = txtDataRx.Text + "Input Time : "+ System.DateTime.Now.ToString();
txtDataRx.Text = txtDataRx.Text + " Card No. : "+ strData;
cmd = "Gy";
msg = Encoding.ASCII.GetBytes(cmd.ToString());
axWinsock1.SendData(msg);
axWinsock1.SendData(msg1);
txtDataRx.Text = txtDataRx.Text + "Door Open";
timer1.Enabled = true;
}
}
catch(Exception se)
{
//MessageBox.Show ( );
string msg = se.ToString();
}
}
HOW I IMPLEMENT THIS FOR MORE THEN ONE READER ?
|
|
|
|
|
hi dear
i am also working in same RFID passive card using door open system
i have card reader and passive card when i show my card that reader read.
here we are using TCP/IP and c# asp.net
when i show the card the cardId or details i want to display into my asp.page
so i want write event or delegates if u have coding pls mail me its my mail Id jagamca.cs@gmail.com
|
|
|
|
|
card reader to machine
machine to card reader via tcp/ip c# asp.net
how to we fire event or delegate
getting data from reader to asp.net page please if you have send me the tcp/ip method
jagamca.cs@gmail.com
|
|
|
|
|
I try these code, but doesn't work,
string file = @"e:\test.log";<br />
<br />
FileStream fs1 = new FileStream(file, FileMode.Append, FileAccess.Write, FileShare.Read);<br />
FileStream fs2 = new FileStream(file, FileMode.Open, FileAccess.Read); <br />
throw an exception:
System.IO.IOException: The process cannot access the file 'e:\test.log' because it is being used by another process..
how to solve this?
Glad to discuss with you and best wishes.
|
|
|
|
|
FileStream fs1 = new FileStream(file, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
FileStream fs2 = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
thanks for your reply, i have tried this, throw the same exception.
i nearly tried all 'FileAccess', 'FileShare' combination
Glad to discuss with you and best wishes.
|
|
|
|
|
well, I check this and its working without any error
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Sorry for my mistake, i create a test project like the first message, and it works.
but in my real project, it always throw the exception...
I wrote a singleton mode class, Logger class, to write log to file.
This logger class has 'LogLevel' property, the actions like in log4net.
then, i wrote a unit test class to test its LogLevel property setting will work.
...
I use the first FileStream in Logger class, then
I use the second FileStream in Logger Unit Test class, to check log message is corrent.
...
the second FileStream always throw that exception.
Glad to discuss with you and best wishes.
|
|
|
|
|
|
glad, you got it work
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
hi
i want to learn OOP concepts any article or toutorial point to above is highly appericated
where i can learn OOP concepts
Best Regards
|
|
|
|
|
|
Hi,
I have a console application to convert XML to HTML through XSLT.
When I try to execute this exe from server (intranet) I encound the following exception:
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed..
Please advice.
Thanks,
HH
|
|
|
|
|
Are you running the application from a network share ? It seems to be fixed in .Net 3.5 SP1. In previous versions it would crash if ran from a share due to the default low trust behavior.
Prior to .Net 3.5 SP1[^]
.Net 3.5 SP1[^]
|
|
|
|
|
Yes I run the exe from shared folder. And I use .Net 3.5 sp 1 - and still facing this problem.
Thanks,
HH
|
|
|
|
|
This is due to CAS. Code access security in .Net. There are restrictions set for each zone (You could see it in intranet option or .Net configuation Cosole in control panel). Usually it is Organiasation wide. or enterprose wide settings. and governed by policies by network managers. You can also change this usign caspol.exe, a net command line tool. But better is to either copy it to your local machine or Remote login to that server. rather than accessing it through shared drive
|
|
|
|
|
Using System;
public Class Class1
{
Public Void Hello()
{
Console.WriteLine("base");
}
}
public Class Class2:Class1
{
Public Void Greet()
{
Console.WriteLine("derived");
}
}
Public Class Demo
{
static Void Main()
{
Class1 C1=new Class1();
C1.Hello();
Class2 C2=new Class2();
C2.Hello();
C2.Greet();
Class1 C3=new Class2();
C3.Hello();
}
}
while executing this code in command prompt it is showing the following error
source file inh.cs could not be found
no inputs specified
is there any error in the syntax if there please rectify
modified on Thursday, February 26, 2009 1:07 AM
|
|
|
|
|
Public public
Class class
Void void
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
how to display datagrid in combobox ?
thanks
|
|
|
|
|
You can't display anything inside a combobox bar text unless you're using WPF. You'd have to build your own control.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
thanks
may be give an example with wpf
i do not work with wpf
|
|
|
|
|
I need to dynamically add a flash object to a C# desktop application. Could someone give me some overview on how to do this. I have been able to add it statically but when I go to try to create it dynamically I come up with unhandled win32 exceptions. Also I need the background to be transparent and having troubles with this too.
Thanks for any help
|
|
|
|
|
A flash control is not going to draw itself transparently, ever. What do you mean by adding it dynamically ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I have a .skin file that the app reads and it needs to know what to load from there. The skin file is built through and editor which contains all the information that it needs to build the form. everything is working well except my flash. See I will never know the exact object or the ammount of objects that need to be loaded. some forms may have 1 flash object were others may have 3 or more or none. Since I will not know I cant go to the front of the form and add my flash object there it will need to be loaded in the back. like all my other controls. And Im not sure how to go about this.
I've seen it done in vb so I'm sure I can do it in C#. the flash object is a circle and when pulling the shockwave flash control onto the form it makes a white box. setting this white box to transparent was also done in vb.
|
|
|
|
|
Heres what windows adds when you pull it into the form.
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HighCapacity));
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.myFlash = new AxShockwaveFlashObjects.AxShockwaveFlash();
((System.ComponentModel.ISupportInitialize)(this.myFlash)).BeginInit();
this.SuspendLayout();
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// myFlash
//
this.myFlash.Enabled = true;
this.myFlash.Location = new System.Drawing.Point(39, 34);
this.myFlash.Name = "myFlash";
this.myFlash.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("myFlash.OcxState")));
this.myFlash.Size = new System.Drawing.Size(192, 192);
this.myFlash.TabIndex = 0;
//
// HighCapacity
//
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.myFlash);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "HighCapacity";
this.TransparencyKey = System.Drawing.SystemColors.Control;
this.Layout += new System.Windows.Forms.LayoutEventHandler(this.HighCapacity_Layout);
((System.ComponentModel.ISupportInitialize)(this.myFlash)).EndInit();
this.ResumeLayout(false);
}
I need to beable to load this dynamically. kinda like how I do this with a picture box
foreach (object obj in sk.IMG) {
imageButton = new PictureBox();
ImgButton imgBtn = (ImgButton)obj;
arLocation = imgBtn.Location.Split(':');
arSize = imgBtn.Size.Split(':');
this.imageButton.Image = new Bitmap(imgBtn.PathOff);
this.imageButton.Name = imgBtn.Name;
this.imageButton.BackColor = Color.Transparent;
this.imageButton.SizeMode = PictureBoxSizeMode.StretchImage;
this.imageButton.Size = new Size(Convert.ToInt32(arSize[0]), Convert.ToInt32(arSize[1]));
this.imageButton.Location = new Point(Convert.ToInt32(arLocation[0]), Convert.ToInt32(arLocation[1]));
this.imageButton.Cursor = Cursors.Hand;
this.imageButton.MouseDown += new MouseEventHandler(this.ImgButtonKeyDown);
this.imageButton.MouseHover += new EventHandler(imageButton_MouseHover);
this.imageButton.MouseLeave += new EventHandler(imageButton_MouseLeave);
this.menuOff.Controls.Add(this.imageButton);
}
|
|
|
|