Viewed   215 times

The goal is to unserialize a PHP serialized string and get sutable object in C#

Is there any way to make this possible in C#(.Net)?

To be more specific: We need to make an application which comunicates (Via HTTP) to specific website which returns the needed information. Fortunately/unfortunately we dont have permission to website so the data (array mostly) that is returned from website is PHP serialized.



Found solution: Sharp Serialization Library

Wednesday, November 16, 2022

Use .unserializeSession() instead of .unserialize().

Friday, September 16, 2022

I don't know C# but JSON encoding using json_encode() is pretty popular in the web app world as a simple means to transfer simple structures across platforms.

There is a variety of parser classes on the C# end, scroll down in the first link.

Friday, September 23, 2022

Where do you have the type stored?

Normally you could have something like:

class Document {
    public string Type { get; set; }
    public string Name { get; set; }

public class _Filter    
    public _Times Times;    
    public Document Document;    
Friday, December 9, 2022

It could look like this:

#include <iostream>
#include <sstream>
using namespace std;

int main()
    istringstream is("1n2n3n4nn5n");
    string s;
    while (getline(is, s))
        if (s.empty())
            cout << "Empty line." << endl;
            istringstream tmp(s);
            int n;
            tmp >> n;
            cout << n << ' ';
    cout << "Done." << endl;
    return 0;


1 2 3 4 Empty line.
5 Done.

Hope this helps.

Saturday, November 5, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :