|
It is possible, I've seen it before, google it.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
That error is saying the account your code is running under doesn't have the permissions to read the registry on the remote machine. You simply cannot get around this.
You have to use an account that the remote machine can authenticate, such as a Domain Admin account in a domain or AD environment.
In a workgroup environment, the account your code runs under must exist on all the machines you want to connect to AND all those accounts must have the same password.
|
|
|
|
|
Hi,
While executing following line i an getting XML exception
<br />
XslTransform xslt = new XslTransform();<br />
XPathNavigator navigator = xsldoc.CreateNavigator(); try<br />
{<br />
xslt.Load(navigator, null, null);<br />
}<br />
catch(Exception ex)<br />
{<br />
logger.Error("Ex:" + ex.Message + ":" + ex.StackTrace);<br />
}<br />
<br />
Sometimes the above code throws exception with stack strace given below.
<br />
(19,2) :<br />
at System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver xmlResolver, Evidence evidence)<br />
at System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence)<br />
at System.Xml.Xsl.XslTransform.Load(XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence)<br />
I looked at MSDN for these function which mentions that this will work only on .Net FrameWork 1.1
On my machine. I have 1.1, 1.1 with hotfixes, 2.0 and 3.0. FrameWork installed.
Regards
Abhi Lahare
|
|
|
|
|
Hello,
I have a strange problem. I want to send some objectes over Ethernet (UDP One packet is one object) After that I Deserialize the data, but I get allways an exception that there is an Invalid binaryheader. I don't have any idea how I can solve it.
my code is
<br />
int size = socket.Receive(buf);<br />
BinaryFormatter serializer = new BinaryFormatter();<br />
MemoryStream ms = new MemoryStream(buf,0,size);<br />
ms.Seek(0, SeekOrigin.Begin);<br />
LogMessage logMessage = (LogMessage)serializer.Deserialize(ms);<br />
Console::WriteLine("{0}", logMessage.ToString());<br />
ms.Close();<br />
and the sending function:
<br />
MemoryStream ms = new MemoryStream();<br />
BinaryFormatter serializer = new BinaryFormatter();<br />
<br />
serializer.Serialize(ms, logMessage);<br />
ms.Flush();<br />
ms.Seek(0, SeekOrigin.Begin);<br />
<br />
byte[] data = ms.ToArray();<br />
socket.Send(data);<br />
ms.Close();<br />
I have checked the MemoryStream and there is the whole data available (Sending and receiving)
LogMessage
Best regards
Hansjörg
|
|
|
|
|
Are you serializing and deserializing using the same .NET Frameowrk / Operating System?
If you are serializing in, for instance, .NET Framework and the deserializing in .NET Compact Framework, this will be an issue.
Otherwise, you can use the XML Serializer, if platform/framework is your problem
|
|
|
|
|
I use the same computer, same plattform and the both projects are in the same solution from vs2005..
I want to use the binary formatter, because I think it is faster and this is needed in my case.
Best regards
Hansjörg
|
|
|
|
|
Maybe it is a good idea to use the SOAP serializer first for debugging purposes. It is easier to review to XML then. It is not very difficult to switch back to the binary serializer once it all works.
|
|
|
|
|
with the soap formatter I have one problem. If I serialize my object then I get a NullReferenceException. The problem it seems that it is a DateTime field. If this field is not inside the class (other data are strings) all works fine.
Do you have any idea?
Best regards
Hansjörg
|
|
|
|
|
I'm not very experienced with this topic. A NullReferenceExpetion means that soemthing is wrong with an object. Likely causes are that you forgot to assign memory (using new) or maybe you try to use an object that no longer exists. Best way to solve this is stepping through the suspected code using the debugger and checking the object values.
|
|
|
|
|
I have checked it...the object that gives the exception is a DateTime value...and this value is okay. I have no idea why...
Best regards
Hansjörg
|
|
|
|
|
I saw you posted this question in another post. There you mentioned other parameters. Did you check these as well? Also check all other variables you use. Somtimes these errors really are obscure, but it is almost certain you did something wrong. You also may try slight code variations, just to see if these work. Fi replace parameters with constant values, replace the datetime by anonther type of object etc. Just keep trying. It may take you two or three days before you find out.
|
|
|
|
|
I have tried a lot of things and now I have found out the problem. For coding I use c++/cli and there it seems that it is not possible to use the DateTime^, but you have to use DateTime...
Best regards
Hansjörg
|
|
|
|
|
I have seen some funny stuff when closing MemoryStream , remove those .Close() for now. If that is the problem, what does work is placing it in a using block.
|
|
|
|
|
It doesn't help...
With the XmlSerializer it works...(but there I have a problem with the DateTime..I have to set there the XmlIgnoreattribute
Best regards
Hansjörg
|
|
|
|
|
as in subject. And put in into array string.
Training makes perfect....
|
|
|
|
|
Hello,
System.IO.Directory.GetFiles method helps you here.
I returns an array of Filennames.
All the best,
Martin
|
|
|
|
|
thanks Martin.
It really help me. I got all what i want from that.
Training makes perfect....
|
|
|
|
|
Glad I could help!
All the best,
Martin
|
|
|
|
|
Need to write a windows service which reads the mails stores on exchange server and should store into local database.
can any body describe with example,
please urgent
thanks in adavance....
Rahul
|
|
|
|
|
Hello.
Before I describe my dilemma, here's my code, roughly:
List<arraylist> allEntries = new List<arraylist>();
// fill allEntries with ArrayLists
// each ArrayList entered is at *least* of size 4
// allEntries.Count is 3
for (byte i = 0; i < 2; i++)
{
List<arraylist> goodEntries = allEntries.FindAll(delegate(ArrayList al) { return((byte)al[0] == i); });
// do stuff
} // for
The problem: inside the anonymous function, al[0] sometimes gives the values of al[1]. I need it to only compare the values of al[0], never al[1]. I have seen code where the delegate is an object from a user-created class (ex: (delegate(Cars c) { return(c.plateNum < 123); });).
What exactly am I doing wrong?
Any help or advice is appreciated!
|
|
|
|
|
Why are you using ArrayList at all ?
What is al ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sometimes al[0] is returning the result of al[1], are you sure they are not equal in that situation?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
First, I apologize. My code was not correct, and I'm sure that added to the confusion.
Now, al is ArrayList al, and the reason I need al[0] is to see if two ArrayLists
contained in "allEntries" have the same value stored in index 0.
I have tried it when al[0] and al[1] contain the same values, and when they contain
different values. The result is the same, ie, in the anonymous function, al[0]
sometimes gives the values of al[1].
Here is my code again:
List<arraylist> allEntries = new List<arraylist>();
byte id0 = 0, id1 = 1;
byte sid1 = 16, sid2 = 88, sid3 = 100;
ArrayList entry1 = new ArrayList();
ArrayList entry2 = new ArrayList();
ArrayList entry3 = new ArrayList();
entry1.Add(id0);
entry1.Add(sid1);
entry1.Add("John");
entry1.Add("Doe");
entry2.Add(id1);
entry2.Add(sid2);
entry2.Add("Jane");
entry2.Add("Doe");
entry3.Add(id0); // notice index 0 of entry3 and entry1 contains id0
entry3.Add(sid3);
entry3.Add("Joe");
entry3.Add("Doe");
allEntries.Add(entry1);
allEntries.Add(entry2);
allEntries.Add(entry3);
for (byte i = 0; i < 2; i++)
{
List<arraylist> sameIdEntries = allEntries.FindAll(delegate(ArrayList al) { return((byte)al[0] == i); });
// do stuff
} // for
Any help is appreciated!
|
|
|
|
|
I have an ObjectDataSource bound to several columns including a read-only ID column. I am overriding the OnUpdating event and if I look at all the InputParameters everything is good but my ID column is null.
Is there anything special you have to do with a read-only column to get it to capture it and send it to my Update method?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi,
Can you send a bit of your code, I am not exaclty sure what you are trying to so.
Cheers
|
|
|
|