How to implement jquery function in vb.net 2010?
-
QuickBooksDev wrote:
How do you implement a jquery function in vb.net 2010?
With extreme difficulty. Deserialize it from what format? JSON? XML? What?
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiakfrom a php named array string which looks like this: a:2:{s:3:"foo";s:3:"bar";s:3:"bar";s:3:"foo";} Is there a good way of handling this?
-
from a php named array string which looks like this: a:2:{s:3:"foo";s:3:"bar";s:3:"bar";s:3:"foo";} Is there a good way of handling this?
That appears to be JSON, but looks malformed. You can try the stuff found in these[^].
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
That appears to be JSON, but looks malformed. You can try the stuff found in these[^].
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakI am not sure if it is JSON. It is coming from a blob field in a database. What I sent was only an example of a php named array which is what I think it is. Here is the actual text that was sent to me (some text has been changed). It comes from the HikaShop shipping_parms field in the shipping table. o:8:"stdClass":36:{s:19:"shipping_percentage";s:1:"0";s:20:"shipping_per_product";s:1:"0";s:26:"shipping_price_per_product";s:0:"";s:25:"shipping_override_address";s:1:"0";s:30:"shipping_override_address_text";s:0:"";s:11:"access_code";s:17:" 8CDDA11596V5822B1";s:7:"user_id";s:10:"test012345";s:8:"password";s:8:"Aec3fX13";s:14:"shipper_number";s:6:"1X2167";s:11:"pickup_type";s:2:"01";s:16:"destination_type";s:4:"auto";s:15:"negotiated_rate";s:1:"0";s:13:"group_package";s:1:"1";s:13:"include_price";s:1:"1";s:18:"exclude_dimensions";s:1:"0";s:20:"weight_approximation";s:1:"5";s:17:"dim_approximation";s:0:"";s:25:"shipping_warehouse_filter";s:0:"";s:18:"shipping_min_price";s:1:"0";s:18:"shipping_max_price";s:1:"0";s:25:"shipping_virtual_included";s:1:"1";s:22:"shipping_price_use_tax";s:1:"1";s:21:"shipping_min_quantity";s:0:"";s:21:"shipping_max_quantity";s:0:"";s:19:"shipping_min_weight";s:1:"0";s:20:"shipping_weight_unit";s:1:"g";s:19:"shipping_max_weight";s:1:"0";s:19:"shipping_min_volume";s:1:"0";s:18:"shipping_size_unit";s:2:"in";s:19:"shipping_max_volume";s:1:"0";s:19:"shipping_zip_prefix";s:0:"";s:16:"shipping_min_zip";s:0:"";s:16:"shipping_max_zip";s:0:"";s:19:"shipping_zip_suffix";s:0:"";s:11:"methodsList";s:132:"a:4:{s:16:"ups_next_day_air";s:2:"01";s:18:"ups_second_day_air";s:2:"02";s:10:"ups_ground";s:2:"03";s:14:"ups_express_ca";s:2:"01";}";s:14:"warehousesList";s:275:"a:1:{i:0;O:8:"stdClass":8:{s:4:"name";s:7:"Vermont";s:3:"zip";s:5:"41234";s:4:"city";s:6:"Putney";s:7:"country";s:3:"223";s:4:"zone";s:36:"country_United_States_of_America_223";s:9:"zone_name";s:28:"223 United States of America";s:5:"units";s:2:"lb";s:8:"currency";s:1:"2";}}";}
-
I am not sure if it is JSON. It is coming from a blob field in a database. What I sent was only an example of a php named array which is what I think it is. Here is the actual text that was sent to me (some text has been changed). It comes from the HikaShop shipping_parms field in the shipping table. o:8:"stdClass":36:{s:19:"shipping_percentage";s:1:"0";s:20:"shipping_per_product";s:1:"0";s:26:"shipping_price_per_product";s:0:"";s:25:"shipping_override_address";s:1:"0";s:30:"shipping_override_address_text";s:0:"";s:11:"access_code";s:17:" 8CDDA11596V5822B1";s:7:"user_id";s:10:"test012345";s:8:"password";s:8:"Aec3fX13";s:14:"shipper_number";s:6:"1X2167";s:11:"pickup_type";s:2:"01";s:16:"destination_type";s:4:"auto";s:15:"negotiated_rate";s:1:"0";s:13:"group_package";s:1:"1";s:13:"include_price";s:1:"1";s:18:"exclude_dimensions";s:1:"0";s:20:"weight_approximation";s:1:"5";s:17:"dim_approximation";s:0:"";s:25:"shipping_warehouse_filter";s:0:"";s:18:"shipping_min_price";s:1:"0";s:18:"shipping_max_price";s:1:"0";s:25:"shipping_virtual_included";s:1:"1";s:22:"shipping_price_use_tax";s:1:"1";s:21:"shipping_min_quantity";s:0:"";s:21:"shipping_max_quantity";s:0:"";s:19:"shipping_min_weight";s:1:"0";s:20:"shipping_weight_unit";s:1:"g";s:19:"shipping_max_weight";s:1:"0";s:19:"shipping_min_volume";s:1:"0";s:18:"shipping_size_unit";s:2:"in";s:19:"shipping_max_volume";s:1:"0";s:19:"shipping_zip_prefix";s:0:"";s:16:"shipping_min_zip";s:0:"";s:16:"shipping_max_zip";s:0:"";s:19:"shipping_zip_suffix";s:0:"";s:11:"methodsList";s:132:"a:4:{s:16:"ups_next_day_air";s:2:"01";s:18:"ups_second_day_air";s:2:"02";s:10:"ups_ground";s:2:"03";s:14:"ups_express_ca";s:2:"01";}";s:14:"warehousesList";s:275:"a:1:{i:0;O:8:"stdClass":8:{s:4:"name";s:7:"Vermont";s:3:"zip";s:5:"41234";s:4:"city";s:6:"Putney";s:7:"country";s:3:"223";s:4:"zone";s:36:"country_United_States_of_America_223";s:9:"zone_name";s:28:"223 United States of America";s:5:"units";s:2:"lb";s:8:"currency";s:1:"2";}}";}
OK, after looking at that bigger example, that's not JSON. I don't know of a library that handles serialization of PHP objects. But, there is this[^]. You can create a PHP project in your solution that handles serialization and deserialization, creating the objects for you. You can NOT just use an external PHP app because the objects that it creates will not be visible to your .NET code.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Hi I need to serialize a php named array in vb.net 2010 (Desktop app). I believe that the only easy way might be with jquery. How do you implement a jquery function in vb.net 2010? If there is an easier way to covert the php named array string to a .net supported object i.e. array, dictionary or collection, etc. PLEASE LET ME KNOW.
This might help:
http://sourceforge.net/projects/csphpserial/[^]
Sharp Serialization Library serializes and deserializes primitives, ArrayLists and Hashtables, compatible with PHP serialize().
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
This might help:
http://sourceforge.net/projects/csphpserial/[^]
Sharp Serialization Library serializes and deserializes primitives, ArrayLists and Hashtables, compatible with PHP serialize().
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Sharp Serialization Library did not work. Failed in their test project on Hashtable htFile = (Hashtable)this.serializer.Deserialize(stSerial); Unable to cast object of type 'System.String' to type 'System.Collections.Hashtable'. I just clicked on open. Browsed to my file with the data and that was it.
-
OK, after looking at that bigger example, that's not JSON. I don't know of a library that handles serialization of PHP objects. But, there is this[^]. You can create a PHP project in your solution that handles serialization and deserialization, creating the objects for you. You can NOT just use an external PHP app because the objects that it creates will not be visible to your .NET code.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakThe web doc for Phalanger seems a bit complex. What I need is SomeVar = ToClass.ToFunction(BlobString) Plalanger goes into web pages, complex class functions and cannot see how. Perhaps the simple calculates factorial example technique with php Function ToFunction($str) { $ar = unserialize($str); return serialize($array); } VB Dim Ojb as object = ToClass.ToFunction(MyBlobString) would work???
-
The web doc for Phalanger seems a bit complex. What I need is SomeVar = ToClass.ToFunction(BlobString) Plalanger goes into web pages, complex class functions and cannot see how. Perhaps the simple calculates factorial example technique with php Function ToFunction($str) { $ar = unserialize($str); return serialize($array); } VB Dim Ojb as object = ToClass.ToFunction(MyBlobString) would work???
You can't do that. At. All. You cannot combine two different languages in the same code file. You can't even use two different languages in the same Project! The PHP and Managed code execute in completely separate execution environments that don't even know about each other. So, the objects you create in one are not visible in the other. Your only nice solution is to create a seperate PHP project (essentially PHP.NET) that handles serialization and reference it in the VB.NET code.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
You can't do that. At. All. You cannot combine two different languages in the same code file. You can't even use two different languages in the same Project! The PHP and Managed code execute in completely separate execution environments that don't even know about each other. So, the objects you create in one are not visible in the other. Your only nice solution is to create a seperate PHP project (essentially PHP.NET) that handles serialization and reference it in the VB.NET code.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakIf separate programs are created then I am back to a php program creating a file that VB.Net needs to read and Deserialize into some table. So what good is that except possible to make the external interface file being more 'friendly' i.e. Key,Value instead of all the types, length, etc. And this may not work for embedded structions which I believe this blob has. Since each record that I read would need to do the same thing it doesn't even seem to be very practical.
-
If separate programs are created then I am back to a php program creating a file that VB.Net needs to read and Deserialize into some table. So what good is that except possible to make the external interface file being more 'friendly' i.e. Key,Value instead of all the types, length, etc. And this may not work for embedded structions which I believe this blob has. Since each record that I read would need to do the same thing it doesn't even seem to be very practical.
QuickBooksDev wrote:
If separate programs are created
A seperate project in the same solution is compiled to a library .DLL, not a seperate .EXE. It's not different than if you added a C# Class Library project to your Solution.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak