|
Chris - Drop me a line. I've got Dimension Hatross.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm using a windows application (c#.net 2005).
My byte array values are like this, 164, 243, 37, 108, ...
valeus in returned array are almost same order. but values 10 and 13 in original array are moved to the end. but still mising 3 bytes.
when I try with different initial string sometimes i get the exact number of bytes, but still values 10 and 13 in original array are moved to the end.
so the decrypted string is different than original string for that one also.
eg.
original - "1000172;1;PUAY KEE;ANBRTYUIJh JGFT;10041946;SG;M;S1254743J;SG;11091988;11092010;SG"
result - "1000172;1;PUAY K|jj[8�C\b@\"|�2��DS�@\af#�ݧ`-�6�?�T����'k�\akE�;�W��A��1\b�+�`l�E���r"
|
|
|
|
|
The values 13 and 10 are carriage return and line feed, which are used to make a line break in text. This suggests that the printer treats the data as text, not binary values, otherwise those values should not have any special meaning at all.
Therefore you can not send binary data to the printer and expect to get it back unchanged.
Why don't you just say what equiment you are using? Any help you get here is directly related to the information you give, so if you only share a minimal amount of information, you can only get a minimal amount of help.
---
single minded; short sighted; long gone;
|
|
|
|
|
I'm using a "metrologic" scaning device to scan and "SATO" printer to printing. I don't think my problem is related to the device. My barcode is a 2D barcode. When I pass the data as string everything works fine there, when I scan the data I removed those linefeeds and carriage returns. But with the array with the way I'm reading it cant remove those linefeeds and ciarrage returns.
|
|
|
|
|
HI,
Iam tring to print a file(can be word, excel, visio, etc) through c#.
i have used the process and process start info objects and could complete the task bu the constraint is while printing the original file is being opened!
Let us say for example iam printing document1.doc through the code then the document1 is opened first then printing is done at the background, after the completion of printing the document1 is closed by itself. is there a procedure for me to change this behaviour?
gauthee
|
|
|
|
|
gauthee wrote: i have used the process and process start info objects and could complete the task bu the constraint is while printing the original file is being opened!
You mean is opened in Word of Excel, etc?
If so, one solution would be to wait until the file has been sent to the printer(by periodically checking the number of print jobs) and after that close the main application.
The first part can be achieved with this(code suggested by Martin#):
ObjectQuery qry = new ObjectQuery("SELECT * FROM Win32_PrintJob");<br />
ManagementObjectSearcher srchr = new ManagementObjectSearcher(qry);<br />
ManagementObjectCollection coll = srchr.Get();<br />
<br />
int initialJobs = coll.Count;<br />
<br />
while (coll.Count == initialJobs)<br />
{<br />
System.Threading.Thread.Sleep(10);<br />
coll = srchr.Get();<br />
}
Good luck!
|
|
|
|
|
Hi,
I need to compare the records between two datasets, having 5 columns in each.
Dataset1 contains 5 records and Dataset2 contains 100 records.
I need to check whether all the records in dataset1 is present in dataset2 ,
and suppose if the records are not in dataset2 i need to check how many records are not present.
Can anyone help me..
Anuradha
|
|
|
|
|
|
hi
you want to compare the complete row from dataset1 or perticulare column ?
Jintal Patel
|
|
|
|
|
Hi Jintal Patel,
I need to compare the complete row..
I need to find the exact row match.
currently i'm using a for loop
for eg
for(int i=0;i<dataset1.tables(0).rows.count;i++)
{
for(int j="0;j<dataset2.tables(0).rows.count;j++)
{
" <code="" to="" compare="" each="" column="">
if(dataset1.tables(0).rows[i].itemArray[0].tostring()==
dataset2.tables(0).rows[j].itemArray[0].tostring())
{
}
if(dataset1.tables(0).rows[i].itemArray[1].tostring()==
dataset2.tables(0).rows[j].itemArray[1].tostring())
{
}
}
}
Is thr any better way ?
Anu
|
|
|
|
|
for (int i = 0; i <dataset1.tables[0].rows.count; i++)
="" {
="" for="" (int="" j="0;" <="" dataset2.tables[0].rows.count;="" j++)
="" {
="" for(int="" k="0;k">5;k++)
{
if(dataset1.tables(0).rows[i].itemArray[k].tostring()==dataset2.tables(0).rows[i].itemArray[k].tostring())
}
}
}
try this.
Jintal Patel
|
|
|
|
|
There is performance issue with for loop. So i need to know whether we have any inbuilt methods.
Anu
|
|
|
|
|
Have you try using Sql Query?or You don't want to slove using Sql Statement.
Jintal Patel
|
|
|
|
|
Tried to use the DataTable.Select(...) method?
DataSet ds1 = new DataSet(), ds2 = new DataSet();
DataTable t1 = ds1.Tables.Add();
DataTable t2 = ds2.Tables.Add();
for (int i = 1; i <= 2; i++) {
t1.Columns.Add("C" + i.ToString(), typeof(int));
t2.Columns.Add("C" + i.ToString(), typeof(int));
}
for (int i = 0; i <= 5; i++) {
t1.Rows.Add(new object[] { i, i});
}
for (int i = 0; i <= 100; i++) {
t2.Rows.Add(new object[] { i, i });
}
for (int i = 0; i < 5; i++) {
DataRow[] good = t2.Select("(C1 = '" + t1.Rows[i][0].ToString() + "') AND (C2 = '" + t1.Rows[i][1].ToString() + "')");
if (good.Length > 0) {
}
}
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hello Everyone,
Can anybody tell me wht's the diff. between virtual function and new modifier in C#
|
|
|
|
|
Virtual functions
When you have a function defined in a class which you want to allow to be implemented by the inherited classes you can use virtual function.
The virtual function could be implemented by the inherited classes in their own way and the call to the method is decided at runtime.
New Modifier
The new modifier creates the New instance(object) of the class
NIIT Student
|
|
|
|
|
Nitin Sawant wrote: The new modifier creates the New instance(object) of the class
No it doesn't. The new modifier tells the compiler that a method ina derived class is a new implementation and the compiler should hide one of the same name / signature in a base class.
The new operator creates new instances.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Malcolm Smart wrote: and the compiler should hide one of the same name / signature in a base class
So why
class A
{
public void SomeMethod()
{
Console.WriteLine("Base called");
}
}
class B : A
{
public new void SomeMethod()
{
Console.WriteLine("New called");
}
}
public static void Main()
{
A instance = new B();
if (instance is B)
instance.SomeMethod();
RL();
}
writes "Base called" on the console??
Nb. if A.SomeMethod would be virtual and overriden in B , then "New called" would be displayed.
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
gajatko wrote: Nb. if A.SomeMethod would be virtual and overriden in B, then "New called" would be displayed.
Exactly - it is virtual, so the overridden method would be called.
gajatko wrote: public new void SomeMethod()
In class B, you have modified the method as 'new', which removes any inheritance of that method. Type A has no knowledge what so ever of this method now.
gajatko wrote: A instance = new B();
You instantiate a static member of type A with a dynamic instance of type B. Calling the method on this instance will invoke the Type A method, as that is the only method matching the signature, and it has not been overriden.
( I think...!! )
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
|
The first thing you should learn as NIIT is www.google.com. Just out of a bizarre curiosity, I typed both your questions into google, exactly as you typed them here....and guess what....
MP3 - 850,000 hits...hmmm[^]
Txt - 956,000 hits....[^]
Now, as a student, what do you reckon is the better way of getting an answer to these questions? Google, getting nearly 2million responses in less than 0.5 seconds or posting the question here and getting nob all except sarcasm and stupid replies as you are too lazy to even search for this yourself?
Students like you just end up being tomorrow's users...
-- modified at 3:57 Monday 24th September, 2007
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
removed
NIIT Student
modified on Monday, May 17, 2010 10:45 PM
|
|
|
|
|
Nitin Sawant wrote: but i want that from codeproject.com
Why?
OK - you ask on code project. You get maybe 1 or 2 answers. They could be similar, they could be different. YOu look on google, you get a million answers. You look at three or four, or more (there's plenty of them) and you then get a feel for the correct way to do something.
Why I think you want an answer here : It is so you can cut and paste the code, verbatim, without having to understand it, and when you find you can't even do that you have the person who answered your question on hand to guide you through it step by step.
Good luck Sir.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
Nitin Sawant wrote: i know there are many results on google but i want that from codeproject.com
You can still use Google to search CodeProject.com. Just suffix
site:codeproject.com to your search query string and Google will restrict the results from CodeProject.com.
Nitin Sawant wrote: i'm new here
Welcome.
|
|
|
|
|
"Students like you just end up being tomorrow's users... "
That was not necessary - Sorry.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|