How PHP sentence looks on C# [closed] - c#

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.

Related

How to send C# objects to PHP pages? [closed]

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

store a file in an array word by word [closed]

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 am tring to make a C# code to read from a notepad file, so how to store it in an array word by word or how to make it read and stop at a certain special mark?
for example
read$ from$ file$
and it should be stored in the array as
read
from
file
File.ReadAllLines("file.txt").Split("$")
Use following code.
String[] tokens = File.ReadAllText("file.txt").Split('$');
tokens string array will be having you required string values.
Save as you said. At the time of retrieving Split data with '$'. It will give you array.
string[] strarr = mytxtdata.Split('$');

convert this code from c++ to C# [closed]

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 cant convert d->max to C# i use openssl and the problem of convert c++ to C# the bignum of Rsa->d i cant found it in Openssl Reference in C# rsa.d not found
rsa->n
rsa->e
If we limit ourselves purely to the code in the question, then -> is the pointer-to-member operator. In C# for both values and references that is ., so the equivalent code is just rsa.n, rsa.e and d.max. Unless it is an unsafe pointer to a struct, in which case rsa->n, rsa->e and d->max (so: the exact same code, but this is very unlikely in most C#).
However, I do not expect that will help you - I think you need to step back a few steps and look at what you are trying to do, rather than blindly trying to convert a sample you don't understand. It may well be that the actual solution here is to use a different library.

Need help finding name of function [closed]

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 11 years ago.
My friend sent me an encoded string which I would assume is Java or C#, but since I code in neither of them I could need some help. The string is as follows:
0x579fb13
I thought about it being base 64 or so at first, but the 0x indicates it's hex or something.
Any help appreciated.
The 0x would indeed normally indicate that it's hex. That looks like a memory location to me, and as such may be (inadvertently) the pointer to the structure containing the encrypted string.

html regex in c# [closed]

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 want to load an url as a string, and then use regex to write out matches in c#.
Downloading an URL as a string is easy using System.Net.WebClient.DownloadString.
Finding matches in the HTML is easy using System.Text.RegularExpressions.Regex.Match.
Both links have good examples on usage.
It's really not a good idea to use regular expressions to match content in HTML. Better is to use regular expressions to match tokens in HTML, and parse it. But then, at that point, you might as well use an existing parser.

Categories