|
Without even reading through the entire post it looks like you have simply dumped in your assignment notes and are hoping someone will do your work for you.
As the people who volunteer to answer questions here are (mostly) paid professionals who have to work with the graduates of the education system you are trying to wrought, do you think that they will be interested in doing your school work for you.
Do some research, make some attempts to design your solution and show that you are capable of thinking, then come back with specific question where you have attempted to solve the problems.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
Never underestimate the power of stupid things in large numbers
--- Serious Sam
|
|
|
|
|
Quote: We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
I am stealing this from you OG if you dont mind. By the way how are you? where have you been these days?
|
|
|
|
|
if i am use many like more than 50 (if{} else{}) statement use in one form he can reduce my project speed either nothing any hazards my project
please sugest me
|
|
|
|
|
If you provide some code showing what you are trying to accomplish, some one here could perhaps suggest an alternative. Using 50 if..else statements would suggest that there is a design fault.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
50 times the same conditions, just in different places? I.e. something like
if (condition1)
{
}
else if (condition2)
{
}
else
{
}
in many functions/properties?
Then you'd better go for an interface and several implementations of it; perhaps with a base class used by all of the implementations.
|
|
|
|
|
Without understanding the logic of your application ... and why you need so many if-else statements ... without seeing your code ... it's hard to try and help you.
Depending on the context there may be a way to optimize the logic. Whether your particular bunch of if/else statements reduce the performance of your application also depends on the complexity of what is evaluated (and the "cost" of that evaluation) in each if/else clause.
In general, if I see fifty if/else statements, I think code needs re-organizing, re-factoring; but, there's no way to tell if that's true for your code with such limited information.
“There are obvious things, and there are many obvious things no one tried, because no one needed to try them.” Sergey Alexandrovich Kryukov, January 1, 2014
|
|
|
|
|
Thanks sir ,
i ma drop my code i have need to check multiple condition and i want immense my code but many time i have need to wrote one line more time please check
nothing any issue regarding if else statement i am only try to make minimize my code and time if you have time please check
----------------
Dim es As Input.KeyEventArgs
If String.IsNullOrEmpty(txt_pname.Text) Then
comlibobj.msg("Please Enter Name", "Warning")
e.Handled = True
Else
cmd = New SqlCommand("", sqlcn)
cmd.CommandType = CommandType.StoredProcedure
Dim flag As String = ""
Dim schcmd As New SqlCommand("SELECT * FROM mschemst WHERE scode='" + txt_pcode.Text + "'", sqlcn)
Dim schrd As SqlDataReader = schcmd.ExecuteReader
While schrd.Read
Dim sxm As String = schrd("scode")
If sxm.Count > 0 Then
userCh = "Modify"
End If
If txt_schfree1.Text = "0" And txt_schfree2.Text = "0" And txt_schfree3.Text = "0" And txt_schqty1.Text = "0" And txt_schqty1.Text = "0" And txt_schqty2.Text = "0" And txt_schqty3.Text = "0" Then
userCh = "Delete"
End If
End While
schrd.Close()
If txt_batchcode.Text.Count > 0 Then
Batchno = txt_batchcode.Text
Else
Batchno = Batchno
End If
If userCh = "Add New" Then
flag = "A"
ElseIf userCh = "Modify" Then
flag = "M"
ElseIf userCh = "Delete" Then
flag = "D"
End If
batch = ""
batch = DirectCast(cmb_batch.SelectedItem, ComboBoxItem).Content.ToString()
txtsno.Text = Val(comlibobj.cdmaker("", "mschemst", "sno", 9999))
If cmb_batch.Visibility = Windows.Visibility.Visible Then
If cmb_batch.Visibility = Windows.Visibility.Visible And cmb_batch.SelectedIndex = 0 Then
System.Windows.MessageBox.Show("Please Select Batch If use Batch Wise Product And enable Select Bacth")
Else
If cmb_batch.SelectedIndex = 1 Then
cmd = New SqlCommand("SELECT BATCHNO FROM mbachmst WHERE BCODE='" + txt_pcode.Text + "'", sqlcn)
rdr = cmd.ExecuteReader
While rdr.Read
Batchno = rdr("BATCHNO").ToString
txtsno.Text = Val(comlibobj.cdmaker("", "mschemst", "sno", 9999))
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
End While
rdr.Close()
Me.Close()
comlibobj.upd()
ElseIf cmb_batch.SelectedIndex = 2 Then
If String.IsNullOrEmpty(txt_batchcode.Text) Then
System.Windows.MessageBox.Show("Batch Cod Field Is blank Please Select Batch")
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
Me.Close()
comlibobj.upd()
End If
End If
End If
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
Me.Close()
comlibobj.upd()
End If
|
|
|
|
|
Please, if you post code here, use the "code" drop down above the entry textbox to format your code. This preserves the formatting by putting the appropriate <pre> tags round it.
Without tags:
If String.IsNullOrEmpty(txt_batchcode.Text) Then
System.Windows.MessageBox.Show("Batch Cod Field Is blank Please Select Batch")
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
With tags:
If String.IsNullOrEmpty(txt_batchcode.Text) Then
System.Windows.MessageBox.Show("Batch Cod Field Is blank Please Select Batch")
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text) Which one would you rather read?
And BTW: look at the forum headings! If you want to post VB, then use a VB forum: http://www.codeproject.com/Forums/1646/Visual-Basic.aspx[^] or QA: http://www.codeproject.com/Questions/ask.aspx[^]
Posting VB in a C# forum is like posting dog-fight adverts on a vegan site...
Never underestimate the power of stupid things in large numbers
--- Serious Sam
|
|
|
|
|
As someone mentioned
* put the code indication (< pre> tags) around your code.
* use the VB forum for VB questions
my two cents of your code:
good
* use of parametrized queries
bad
* although you use parametrized queries you also still use string concatenation with user input. Here´s a good article[^]
* UI, businesslogic and DAL component code in one class and probably even within one method .
* three times the same code block...
* I added inline comments for more detailed info.
Dim es As Input.KeyEventArgs
If String.IsNullOrEmpty(txt_pname.Text) Then
comlibobj.msg("Please Enter Name", "Warning")
e.Handled = True
Else
cmd = New SqlCommand("", sqlcn)
cmd.CommandType = CommandType.StoredProcedure
Dim flag As String = ""
Dim schcmd As New SqlCommand("SELECT * FROM mschemst WHERE scode='" + txt_pcode.Text + "'", sqlcn)
Dim schrd As SqlDataReader = schcmd.ExecuteReader
While schrd.Read
Dim sxm As String = schrd("scode")
If sxm.Count > 0 Then
userCh = "Modify"
End If
If txt_schfree1.Text = "0" And txt_schfree2.Text = "0" And txt_schfree3.Text = "0" And txt_schqty1.Text = "0" And txt_schqty1.Text = "0" And txt_schqty2.Text = "0" And txt_schqty3.Text = "0" Then
userCh = "Delete"
End If
End While
schrd.Close()
If txt_batchcode.Text.Count > 0 Then
Batchno = txt_batchcode.Text
Else
Batchno = Batchno
End If
If userCh = "Add New" Then
flag = "A"
ElseIf userCh = "Modify" Then
flag = "M"
ElseIf userCh = "Delete" Then
flag = "D"
End If
batch = ""
batch = DirectCast(cmb_batch.SelectedItem, ComboBoxItem).Content.ToString()
txtsno.Text = Val(comlibobj.cdmaker("", "mschemst", "sno", 9999))
If cmb_batch.Visibility = Windows.Visibility.Visible Then
If cmb_batch.Visibility = Windows.Visibility.Visible And cmb_batch.SelectedIndex = 0 Then
System.Windows.MessageBox.Show("Please Select Batch If use Batch Wise Product And enable Select Bacth")
Else
If cmb_batch.SelectedIndex = 1 Then
cmd = New SqlCommand("SELECT BATCHNO FROM mbachmst WHERE BCODE='" + txt_pcode.Text + "'", sqlcn)
rdr = cmd.ExecuteReader
While rdr.Read
Batchno = rdr("BATCHNO").ToString
txtsno.Text = Val(comlibobj.cdmaker("", "mschemst", "sno", 9999))
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
End While
rdr.Close()
Me.Close()
comlibobj.upd()
ElseIf cmb_batch.SelectedIndex = 2 Then
If String.IsNullOrEmpty(txt_batchcode.Text) Then
System.Windows.MessageBox.Show("Batch Cod Field Is blank Please Select Batch")
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
Me.Close()
comlibobj.upd()
End If
End If
End If
Else
Try
cmd.Parameters.AddWithValue("@flag", flag)
cmd.Parameters.AddWithValue("@sno", txtsno.Text)
cmd.Parameters.AddWithValue("@scode", txt_pcode.Text)
cmd.Parameters.AddWithValue("@SBATCHNO", Batchno)
cmd.Parameters.AddWithValue("@sqty1", txt_schqty1.Text)
cmd.Parameters.AddWithValue("@sfree1", txt_schfree1.Text)
cmd.Parameters.AddWithValue("@sqty2", txt_schqty2.Text)
cmd.Parameters.AddWithValue("@sfree2", txt_schfree2.Text)
cmd.Parameters.AddWithValue("@sqty3", txt_schqty3.Text)
cmd.Parameters.AddWithValue("@sfree3", txt_schfree3.Text)
cmd.Parameters.AddWithValue("@sfromdt", comlibobj.Datecheck(txt_sfromdt.Text))
cmd.Parameters.AddWithValue("@senddt", comlibobj.Datecheck(txt_senddt.Text))
cmd.Parameters.AddWithValue("@smes", txt_smes.Text)
cmd.Parameters.AddWithValue("@sminstk", IIf(txt_minstk.Text = 0, 0, txt_minstk.Text))
cmd.ExecuteNonQuery()
Catch agex As Exception
MsgBox(agex.Message)
End Try
cmd.Dispose()
Me.Close()
comlibobj.upd()
End If
In short, throw this away and start new, with n-tier development. (use this as base for the logic you tried to achieve)
hope this helps.
|
|
|
|
|
thanks i have need only guideline on my code write and you give me thanks
really i am try to write best code
|
|
|
|
|
The project speed could be reduced by a 'slow' algorithm. If your if-else chain is the implementation of a slow algorithm then, yes, they are going to reduce the performance of your application.
Veni, vidi, vici.
|
|
|
|
|
Quote: if i a use more than 50 (if{} else{}) statements in one form can it reduce my project speed or cause any hazard to my project?
Was this was your question?
What are you trying to accomplish? i mean why do you want to use 50 if elses? why not switch cases?
Whats the difference between them?
Do some self assessment. And please post your code. So that i can atleast look into it.
One more doubt:
Are you doing all of this on form load?
|
|
|
|
|
I am making and RPG and have coded the movement and animation for the sprites. When I run the project, the sprite will move down or right. When the right arrow key is pressed, the sprite will move right, but will not stop. When the down key is pressed, the sprite will move down, and stop when the key is released. However, when you press another arrow key once you have pressed the down or right key, the sprite image won't change direction. Also, the sprite images do not change when a new arrow key is pressed. Why is this happening? Any help is appreciated.
Game.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace RPG
{
public class Game1 : Game
{
#region Fields
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Vector2 aPosition = new Vector2(250, 100);
MageChar mageSprite;
#endregion
#region Initialization
public Game1 ()
{
graphics = new GraphicsDeviceManager (this);
Content.RootDirectory = "Content";
graphics.IsFullScreen = false;
}
protected override void Initialize()
{
mageSprite = new MageChar();
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
mageSprite.LoadContent(this.Content);
}
#endregion
#region Update and Draw
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
mageSprite.Update(gameTime);
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
mageSprite.Draw(this.spriteBatch);
spriteBatch.End();
base.Draw(gameTime);
}
#endregion
}
}
CharMovement
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace RPG
{
public class CharMovement
{
public string charSprite;
public Rectangle Size;
private float mScale = 1.0f;
public Vector2 Position = new Vector2(0, 0);
private Texture2D charTexture;
public void LoadContent(ContentManager theContentManager, string theCharSprite)
{
charTexture = theContentManager.Load<Texture2D>(theCharSprite);
theCharSprite = charSprite;
Size = new Rectangle(0, 0, (int)(charTexture.Width * mScale), (int)(charTexture.Height * mScale));
}
public void Update(GameTime theGameTime, Vector2 theSpeed, Vector2 theDirection)
{
Position += theDirection * theSpeed * (float)theGameTime.ElapsedGameTime.TotalSeconds;
if (Position.X < 0)
{
Position.X = 0;
}
if (Position.Y < 0)
{
Position.Y = 0;
}
}
public void Draw(SpriteBatch theSpriteBatch)
{
theSpriteBatch.Draw(charTexture, Position,
new Rectangle(0, 0, charTexture.Width, charTexture.Height),
Color.White, 0.0f, Vector2.Zero, mScale, SpriteEffects.None, 0);
}
}
}
MageChar.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace RPG
{
public class MageChar : CharMovement
{
string MageAssetName = "WalkingFront";
const int StartPositionX = 0;
const int StartPositionY = 0;
const int MageSpeed = 160;
const int MoveUp = 1;
const int MoveDown = 1;
const int MoveLeft = 1;
const int MoveRight = 1;
enum State
{
WalkingLeft,
WalkingRight,
WalkingFront,
WalkingBack
}
State CurrentState = State.WalkingFront;
Vector2 Direction = Vector2.Zero;
Vector2 Speed = Vector2.Zero;
KeyboardState PreviousKeyboardState;
public void LoadContent(ContentManager theContentManager)
{
Position = new Vector2(StartPositionX, StartPositionY);
base.LoadContent(theContentManager, MageAssetName);
}
private void Update(KeyboardState aCurrentKeyboardState)
{
if (CurrentState == State.WalkingFront)
{
Speed = Vector2.Zero;
Direction = Vector2.Zero;
if (aCurrentKeyboardState.IsKeyDown(Keys.Left) == true)
{
CurrentState = State.WalkingLeft;
MageAssetName = "WalkingLeft";
Speed.X -= MageSpeed;
Direction.X -= MoveLeft;
}
else if (aCurrentKeyboardState.IsKeyDown(Keys.Right) == true)
{
CurrentState = State.WalkingRight;
MageAssetName = "WalkingRight";
Speed.X += MageSpeed;
Direction.X += MoveRight;
}
if (aCurrentKeyboardState.IsKeyDown(Keys.Up) == true)
{
CurrentState = State.WalkingBack;
MageAssetName = "WalkingBack";
Speed.Y += MageSpeed;
Direction.Y += MoveUp;
}
else if (aCurrentKeyboardState.IsKeyDown(Keys.Down) == true)
{
CurrentState = State.WalkingFront;
MageAssetName = "WalkingFront";
Speed.Y -= MageSpeed;
Direction.Y -= MoveDown;
}
}
}
public void Update(GameTime theGameTime)
{
KeyboardState aCurrentKeyboardState = Keyboard.GetState();
Update(aCurrentKeyboardState);
PreviousKeyboardState = aCurrentKeyboardState;
base.Update(theGameTime, Speed, Direction);
}
}
}
|
|
|
|
|
What about that block of code:
private void Update(KeyboardState aCurrentKeyboardState)
{
if (CurrentState == State.WalkingFront)
and all other states are ignored. I guess the problem is here.
|
|
|
|
|
oh okay, thanks. I'll fix that part.
|
|
|
|
|
I'm currently working on a project that uses an RFID reader that reads RFID tags and uses a ASP.Net,C# program to store the tags data into an SQL database(Godaddy Server windows), but the problem here is that I need to connect RFID Reader (to read the data and store it to the database), so how can I do that?? Also, I may need to control the parallel port from the ASP.NET.
for at homw i want to test it .. so i m going to purchase the device and test it and present it ..
so place let me know on this how to start
|
|
|
|
|
Ask the RFID vendor for details on integrating the reader to your ASP.NET app, e.g. documentation and demo code will be helpful.
|
|
|
|
|
sandsip wrote: the problem here is that I need to connect RFID Reader (to read the data and store it to the database), so how can I do that?? Also, I may need to control the parallel port from the ASP.NET. The problem is that you can't access local hardware using ASP.NET.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I doubt that you can access the RFID re4ader directly from the ASP.Net code, which means you need to do some tweaking with ActiveX or Java Applets - The RFID reader vendor can tell you the details.
About accessing the Serial Port: Accessing anything locally from a webpage breaks most browser's security principles, thus it is hard to achieve. After some searching I found the following solution which allows you to access local serial ports on the client from the web page, but it is only promised to work in IE (other browsers may work, but not tested).
http://strokescribe.com/en/serial-port-internet-explorer.html[^]
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
Marco Bertschi wrote: About accessing the Serial Port: You're describing it as if they are two separate problems; one would need ActiveX to access a local resource. Both the port and the reader are local resources.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
yes - But I have no idea how the RFID scanner works in detail, that's why I only guarantee the correctness of my answer for the serial port issue.
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
Why don't you create a Windows application that accesses the RFID reader and then posts the data to the ASP.NET site, instead of trying to do it directly from ASP.NET?
|
|
|
|
|
Can't the RFID reader emulate a keyboard? At least, barcode reader can normally do so.
OK, if you want to send a command to it in order to initiate the reading, then that would not work so easily from a web page. But when it is OK that the user sets the cursor into the correct input field on the page and then presses a button on the hardware, that will work.
|
|
|
|
|
Hi, we have a project with Kinect which is about obstacle detection and face recognition and we need to know if the obstacle is on the ground or not because we want to warn the user "Obstacle on the groud, step on it" if there's an obstacle like stairs, box etc. We work with Emgu CV and we use blob detection to find connected components on the depth map and we do it with opencv functions. Detecting the floor would also help us to say "the floor is not an obstacle" because you know if the camera is placed close to the ground it may detect the floor as an obstacle which is so unwanted situation.
So we need some suggestions, which methods can we use? Is there any function in Emgu CV(we didn't find any ). We've found out that OpenNI has a getfloor function but we don't want to use that because project deadline is soon and maybe dealing with OpenNI when we are already using opencv might cause some problems and on the presentation maybe some problems may occur and our app would crash.
Any suggestions would be greatly appreciated.
|
|
|
|
|