|
I'm not able to send APDU to a smart card using winsCard library.
I'm developing in C# 2005, probably the problem is in the definition of
SCardTransmit on winscard or in parameter I'm trying to pass.
if I use the following definition on winscard, SCardTransmit returns 22...
static extern uint SCardTransmit(uint hCard, IntPtr pioSendPci, byte[]
pbSendBuffer, int cbSendLength, ref SCARD_IO_REQUEST pioRecvPci, ref byte[]
pbRecvBuffer, ref int pcbRecvLength);
SCARD_IO_REQUEST ioRecv = new SCARD_IO_REQUEST();
ioRecv.cbPciLength = 0;
byte[] pbRecvBuffer = new byte[2];
int pcbRecvLength = 2;
byte[] pbSendBuffer = { (byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)
0x0A, (byte)0x65, (byte)0x78, (byte)0x6D, (byte)0x5F, (byte)0x77, (byte)0x61,
(byte)0x6C, (byte)0x6C, (byte)0x65, (byte)0x74, (byte)0x00 };
int cbSendLength = pbSendBuffer.Length;
IntPtr pioSendPci = GetPciT0();
uint errors = SCardTransmit(hCard, pioSendPci, pbSendBuffer, cbSendLength,
ref ioRecv, ref pbRecvBuffer, ref pcbRecvLength);
if I use the definition below the error is 2148532243...
uint errors = SCardTransmit(hCard, new SCARD_IO_REQUEST(), pbSendBuffer,
cbSendLength, ioRecv, ref pbRecvBuffer, ref pcbRecvLength);
SCARD_IO_REQUEST ioRecv = new SCARD_IO_REQUEST();
ioRecv.cbPciLength = 0;
byte[] pbRecvBuffer = new byte[2];
int pcbRecvLength = 2;
byte[] pbSendBuffer = { (byte)0x00, (byte)0xA4, (byte)0x04, (byte)0x00, (byte)
0x0A, (byte)0x65, (byte)0x78, (byte)0x6D, (byte)0x5F, (byte)0x77, (byte)0x61,
(byte)0x6C, (byte)0x6C, (byte)0x65, (byte)0x74, (byte)0x00 };
int cbSendLength = pbSendBuffer.Length;
IntPtr pioSendPci = GetPciT0();
uint errors = SCardTransmit(hCard, new SCARD_IO_REQUEST(), pbSendBuffer,
cbSendLength, ioRecv, ref pbRecvBuffer, ref pcbRecvLength);
I've tried changing length of the response, the reference of parameters,
passing null pointer, ecc... but nothing changes.
If you have some advice or better some sample code, it's really appreciated
Thanks in advance
|
|
|
|
|
I am doing a topic about "encrypt text into an image". Who can help me?
Could you tell me how to do it? If you have source, Please send to me. Thanks.
|
|
|
|
|
Please refer to the replies you recieved the last time you posted on Jan 18th 2008 here[^]
Now what bit of this are you having difficulty with? Give us something specific and we'll answer if we can!
The first thing I'd suggest is having a look at Byte arrays ( byte[] ).
Dave
|
|
|
|
|
Thank for your help
I understood the structure of image but
I don't know how to do to encrypt a text file into an image and decrypt again.
with Byte arrays, I understood it, too
Thank you very much for your help
---Thuc---
|
|
|
|
|
there are some documents on steganography in the codeproject articles, might be worth taking a look at some of those.
|
|
|
|
|
Ask Corinna John http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=475133[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
hi all,
How to identify bookmarks and hyperlinks in a pdf file
The need for me is to identify the following
1. To identify broken bookmarks(ie., Book marks not pointing to any location in the pdf)
2. To identify Bookmarks with null text.
3. To identify the Hyperlinks pointing to web page
4. To identify broken hyperlinks (ie., hyperlink pointing to null location)
Thanks in advance
regards
mist
|
|
|
|
|
THanks for listing your requirements, unfortunately, no one cares about them. What are the specific problems you are having in implementing them?
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
I would like to have a property to appear in a visual designer where the user can browse for a file, instead of just entering the path manually.
In a visual designer, your custom component can have properties which are displayed in the properties window of hte designer. For instance, if your property is of type bool , the designer lets you choose between true or false. Likely, if your property is of type Enum , the designer displays the list of the enum values you defined.
Now, I am pretty sure that I can have a property that will make the designer put ellipsis (...) so the user can click it and browse for a file.
If this is possible, what would be the type of my property?
|
|
|
|
|
|
|
Hi, I am creating a 5 star rating control using callbacks.
I am not able to send the value to the parent page and then save it. When I try to capture the click event of the image, I guess multiple events occur and then I loose the actual value. The actual value does not persists.
I have used five image controls and One hiddenField named 'hdn' and have written javascript functions for handling the OnMouseOver, OnMouseOut and Click Event. The functions are s follows:
--------Image Click Event----------
function onImgClick(strVal)
{
var countRec;
var imgName;
var message = strVal + ":" + "Click";
var context = "Click";
CallServer(message, context);
}
------------------------------------
----------OnMouseOver--------------
function callSwapImage(strVal)
{
var countRec;
var imgName;
for (countRec = 1; countRec<=parseInt(strVal); countRec++)
{
imgName = "imgStar" + String(countRec);
document.images[imgName].src = "images/starGold.gif";
}
}
---------OnMouseOut------------
function callSwapRedo()
{
var message = document.getElementById("rc1_hdn").value + ":" + "Redo";
var context = "Redo";
CallServer(message, context);
}
-------------------------------
In the code behind file of the user control I have written the following code in the Page_Load Event
protected void Page_Load(object sender, EventArgs e)
{
sCallBackFunctionInvocation = Page.ClientScript.GetCallbackEventReference(this, "message", "ShowSuccess",
"context");
String callbackScript;
callbackScript = "function CallServer(message, context)" +
"{ " + sCallBackFunctionInvocation + ";}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"CallServer", callbackScript, true);
HiddenField hdn = new HiddenField();
}
For the RaiseCallbackEvent I have written
public void RaiseCallbackEvent(string eventArgument)
{
string[] remCount = new string[2];
if (Rated != null)
{
if (eventArgument != "")
{
remCount = eventArgument.Split(':');
if (remCount[1] == "Click")
{
EventArgs args = new EventArgs();
Rated(this, args);
}
}
if (hdn.Value.ToString() == "" && remCount[0] == "0")
{
returnValue = "0";
totChecked = returnValue;
hdn.Value = returnValue;
}
else
{
returnValue = remCount[0];
hdn.Value = returnValue;
totChecked = returnValue;
}
}
RateVal = returnValue;
}
The below function is written to send the result back to the client end
public string GetCallbackResult()
{
return returnValue;
}
-----------------------------------
My problem comes now that I want to send the value for the image clicked to the parent page so that I can save the rating. For this I have declared the following event before the page load
public event System.EventHandler Rated;
and then I have declared the event handler for the same in my parent page
protected void Page_Load(object sender, EventArgs e)
{
rc1.Rated += new EventHandler(rc_fetchData);
//rc.Rated += new CommandEventHandler(rc_fetchData);
}
private void rc_fetchData(object sender, EventArgs e)
{
lblMsg.Text = ((HiddenField)rc1.FindControl("hdn")).Value.ToString();
//((HiddenField)rc.FindControl("hdn")).Value.ToString();
}
-----Have A Nice Day-----
|
|
|
|
|
How can i use two filters in the following code
person pp = obj.Find(delegate(person p) { return p.name == "abc"; });
because there should be one return statement in a single block.
So how will i declare another filter to refine the record
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Sonia - you asked this question below. Don't repost questions, continue threads instead as this is just plain rude.
|
|
|
|
|
You can write several statements and use logical operators to return the value according to your filter requirements.
Logical Operators in C#[^]
|
|
|
|
|
person pp = obj.Find(delegate(person p) { return p.name == "abc" && BUY_A_BLOODY_C#_BOOK_FOR_THE_HUNDREDTH_TIME; });
|
|
|
|
|
Possibly a little too subtle. I still don't think she'll get it.
|
|
|
|
|
Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit
|
|
|
|
|
J4amieC wrote: Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit
Oh I don't know. That post made me laugh. I even showed it to people.
|
|
|
|
|
hi
i m newbie to C#.net , i have to create a usercontrol with a gridview in it i have to set its datasource to the dataset used in its parent form to do this i am setting properties at the usercontrol like this :
[System.ComponentModel.ComplexBindingProperties("DataSource","DataMember")]
public partial class UserControl1 : UserControl
{
public object DataSource
{
get
{
return dgvSearch.DataSource;
}
set
{
dgvSearch.DataSource = value;
}
}
public string DataMember
{
get{ return dgvSearch.DataMember ;}
set { dgvSearch.DataMember = value; }
}
public UserControl1()
{
InitializeComponent() ;
}
and from parent form i am setting the datasources for my parent control
BindingSource datasource;
DataSet data=new C21_SecurityDataSet() ;
DataTable dt = data.Tables.Add();
userControl11.DataSource = datasource = new BindingSource (data, "users");
usercontrol11.dataMember="users"
but no data displayed at my user control plz help me out
thanks
|
|
|
|
|
I have the column of type string in the database
Following is the data in that column
1
2
11
12
21
abc
If i sort the table with the help of this column then the output come in the following manner
1
11
12
2
21
abc
can i improve the order actually i want the output like 1 2 11 12 21 abc
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Why not add order by [column name] ASC
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
You could, but only with some extremely fancy logic. It's a string, so you have to abide by the rules of strings. Off the top of my head, I would think that you would have to remove the numeric type strings and sort them independently of the non-numeric strings and then combine the two together.
|
|
|
|
|
i can use the union query to first select the numeric and then an another union query to sort alphanumeric.
Am i doing right?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Sonia Gupta wrote: i can use the union query to first select the numeric and then an another union query to sort alphanumeric.
Am i doing right?
For the love of God Sonia, just try it. I'm not going to type your code out for you.
|
|
|
|
|