 |
| ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 25th, 2010, 11:51 AM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
i need help( convert c to vb.net)
i have a vb.net web,and i found in the internet a code that i need.
but the code is in c,can sombody here convert it to vb? i try many web conveting but they not good enough.
PHP Code:
attachment attachment = new attachment();
attachment.caption = "www.icanhascheezburger.com";
attachment.name = "I am bursting with joy";
attachment.href = "http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/";
attachment.description = "a funny looking cat";
attachment.properties = new attachment_property()
{
category = new attachment_category()
{
href = "http://www.icanhascheezburger.com/category/humor",
text = "humor"
},
ratings = "5 stars"
};
attachment.media = new List<attachment_media>(){new attachment_media_image()
{
src = "http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg",
href = "http://icanhascheezburger.com/2009/04/22/funny-pictures-bursting-with-joy/"
}};
|
|

October 25th, 2010, 01:07 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
HI there..
This look straighfoward to translate.. What are your problems with this code???
(it's not c, it's C#). Probably the online translator have problems because there are a lot of clases involved (that shouldn't be translated).
__________________
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the proof.
================================================== =========
|
|

October 25th, 2010, 01:13 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Did you try: http://converter.telerik.com/ It should convert this just fine...
Imar
|
|

October 25th, 2010, 03:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
|
|

October 25th, 2010, 07:31 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
no,but thanks for trying.
|
|

October 26th, 2010, 02:25 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It's a bit difficult to say for sure as your classes are unknown to me, but something like this should at least compile:
Notice how I changed attachment_media_image to attachment_media, as I doubt that the original code compiled (unless attachment_media_image inherits attachment_media).
Cheers,
Imar
|
|

October 26th, 2010, 06:26 AM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
PHP Code:
attachment.media = New List(Of attachment_media)()
With New attachment_media_image
.type=attachment_media_type.image
.src = "http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs322.snc4/41570_161882717169966_2773595_n.jpg"
.href = "http://www.facebook.com/album.php?profile=1&id=1521763369#!/pages/nynt-tyyb-bsznh-lwhtt-18-l-mwmlz-lmy-smryz-wth/160559677301999"
End With
this good?
|
|

October 26th, 2010, 01:07 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
If it compiles: yes. If it doesn't: no.
My guess is it doesn't as you haven't implemented my modifications such as From to initialize a collection, and the matching types in the generics list and the type you try to create.
But why don't you simplify this code? E.g.:
Code:
Dim myList As New List (Of Media_Attachment()
Dim att = New Media_Attachment()
att.src = "...."
.....
myList.Add(att)
Cheers,
Imar
|
|

October 26th, 2010, 01:44 PM
|
|
Authorized User
|
|
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
|
|
its not work,its run bot not good,my last script run too but not work.
its a application for thr facebook,i think i need a json code for that....
|
|
 |