It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
What is the best way to transfer an object from C# to PHP?
Lets say I have this:
class MyClass {
public string name;
public int id;
}
I then want to send it to a PHP page and receive it as an object (I have more complex datatypes in mind).
How can I do that, from the C# side and from the PHP side?
One way is to serialise to and from a text based format, for example JSON. Both languages should have ready-made serializers. Or XML if you prefer that.
You could use "nusoap" on php side and xml serializers on C# side
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I do not know PHP, could anyone explain me how $data.$prop looks on C#?
If $data has "some_data" value and $prop has "some_other_data" value, the $data.$prop is "some_data.some_other_data", Right?
I would like to implement next line on C#: sha1(md5($data.$prop)). There is concatenation of strings inside of brackets?
You can find out more about SHA1 here and about MD5 here. In C# string concatenation is done with operator +. So if you have two variables named data and prop, both strings, you would concatenate them with the following code:
string result = data + prop;
You have the examples for using cryptography classes on the links provided.
It depends on the what $data and $prop are.
If they are strings
They will will be concatenated.
If $data is a object and $prop is a property
You need to look at reflection. See C# Reflection: How to get class reference from string? for more info.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
The SerializableAttribute class is explained on this link. In the start it is written:
Indicates that a class can be serialized
Can anybody expalin what this means (the bold part). I am not clear about it.
Serializing an object (an instance of a class) means turning it into something that can be written on a file or broadcasted over the network, such as an XML file (Xml serialization) or a Byte array (binary serialization).
This needs to be a two way operation, so you must be able to "Deserialize" the object.
In order to be serializeble an object must contains just serializable fields/property or fields marked as not serialized. For example a Sql connection is not serialized (it would make no sense deserializing it somewhere else...)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
First sorry for my bad English.
I have to use a similar class to RSAKey, from hurlan in C#, but I can't find anything similar, and I don't really understand what exactly this class does.
Do you know any equivalent to this (per example in BouncyCastle), or can you explain me what it exactly does?
Thanks!
Read more about RSA here. It's a public key encryption protocol. (read What is public key crytography ?)
In C#, you have to use :
With .Net 4.5 : System.Security.Cryptography.RSACryptoServiceProvider
With WinRT : AsymmetricKeyAlgorithmProvider
Hope this helps
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
In a C# code, how can we pass a dynamically created Java class object into a another Java class function in a COM interop based project?
I'm not familiar with COM consumption/deployment in Java, but I'm sure a Java class exposed through COM to C# will look just like a C# class to the C# side.
So, the answer is to just pass the Java object to the Java method just like you would pass a C# object to a C# method.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to map features that I used from .net with Ruby
How can I create c# .net generic list like in Ruby?
public class ClientList : List<Client> { }
Ruby is a very dynamic language. It does not have strong types like in C#, and therefore, it does not have (or need generics).
You can create a List in Ruby like this:
list = []
http://langref.org/ruby/lists
class A
end
list = [] # create
list << A.new # add
Something like this? Here list is dynamic you can add any object to it.