Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 25th, 2010, 11:51 AM
Authorized User
Points: 221, Level: 4
Points: 221, Level: 4 Points: 221, Level: 4 Points: 221, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
Default 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/"
                                    
}}; 
  #2 (permalink)  
Old October 25th, 2010, 01:07 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

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.
================================================== =========
  #3 (permalink)  
Old October 25th, 2010, 01:13 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Did you try: http://converter.telerik.com/ It should convert this just fine...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #4 (permalink)  
Old October 25th, 2010, 01:35 PM
Authorized User
Points: 221, Level: 4
Points: 221, Level: 4 Points: 221, Level: 4 Points: 221, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
Default

i try it now and i got a error
http://img829.imageshack.us/img829/4630/aspk.jpg
how do i fix it ?
  #5 (permalink)  
Old October 25th, 2010, 03:33 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Maybe this helps?

http://www.lmgtfy.com/?q=%22Name+of+...ith+%27.%27%22

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #6 (permalink)  
Old October 25th, 2010, 07:31 PM
Authorized User
Points: 221, Level: 4
Points: 221, Level: 4 Points: 221, Level: 4 Points: 221, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
Default

no,but thanks for trying.
  #7 (permalink)  
Old October 26th, 2010, 02:25 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

It's a bit difficult to say for sure as your classes are unknown to me, but something like this should at least compile:

Code:
 
Dim attachment As New Attachment()
...
attachment.Caption = "www.icanhascheezburger.com"
attachment.media = New List(Of attachment_media) From { _
   New attachment_media() With { _
     .Src = "http://icanhascheezburger.files.word...-with-joy1.jpg", _
     .Href = "http://icanhascheezburger.com/2009/0...ting-with-joy/" _
   }
}
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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #8 (permalink)  
Old October 26th, 2010, 06:26 AM
Authorized User
Points: 221, Level: 4
Points: 221, Level: 4 Points: 221, Level: 4 Points: 221, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
Default

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?
  #9 (permalink)  
Old October 26th, 2010, 01:07 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
this good?
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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #10 (permalink)  
Old October 26th, 2010, 01:44 PM
Authorized User
Points: 221, Level: 4
Points: 221, Level: 4 Points: 221, Level: 4 Points: 221, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2010
Posts: 55
Thanks: 9
Thanked 0 Times in 0 Posts
Default

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....
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a vb.net line to C# Nishapd C# 2005 1 May 8th, 2009 12:45 PM
VB.NET 2003 Appendix B convert to VB 2008 Express Edition brucechess BOOK: Beginning VB.NET Databases 10 February 5th, 2009 12:52 PM
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
Syntax Help - Convert C# to VB.NET ank2go ASP.NET 1.0 and 1.1 Professional 3 July 7th, 2004 09:33 PM
Help - Convert from C# to VB.Net CrazyLegsCooper VS.NET 2002/2003 1 July 20th, 2003 10:06 AM



All times are GMT -4. The time now is 11:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.