locked
Error RRS feed

  • Question

  • Hey i have made a class

    Class File
    
    end class
    class form1
    sub x()
    dim y as new file
    end sub
    end class

    I wrote it in vb.net 2010 and vb.net 2012

    it gives an error in vb.net 2012 but not in 2010

    error on line "Dim y as new file"


    Allow time to reverse.















    • Changed type Mike Feng Wednesday, November 28, 2012 8:28 AM
    • Changed type Mark Liu-lxf Wednesday, November 28, 2012 8:42 AM
    • Edited by Abdu Rahman Friday, November 30, 2012 3:56 PM Pieter Geerkens
    • Changed type Abdu Rahman Friday, November 30, 2012 3:56 PM No
    • Changed type Mark Liu-lxf Friday, December 7, 2012 7:16 AM
    • Changed type Mark Liu-lxf Friday, December 7, 2012 7:16 AM
    • Moved by Paul Ishak Saturday, January 12, 2013 10:07 PM User asks strange questions under the guise of having an actual need, for the sake of asking questions to troll forums
    Saturday, November 24, 2012 9:50 AM

Answers

  • if this error occurs then there is no reference or no import to the IO.File class

    http://msdn.microsoft.com/en-US/library/system.io.file(v=vs.110).aspx

    Versions are not always complete equal for this part of handling the code.

    Therefore check that in version 2012, the easiest way is to put in top of your code.

    Import System.Io
    Be aware that although you show up in this forum to be a child younger than 10 does it not mean you should not behave like a real programmer.


    Success
    Cor


    • Edited by Cor Ligthert Monday, December 3, 2012 9:01 AM
    • Proposed as answer by Mark Liu-lxf Wednesday, December 5, 2012 5:55 AM
    • Unmarked as answer by Mark Liu-lxf Friday, December 7, 2012 7:16 AM
    • Marked as answer by Mark Liu-lxf Friday, December 7, 2012 7:16 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    Monday, December 3, 2012 8:59 AM

All replies

  • Hi Abdu!

      Please forgive me, but I'm having a tough time understanding your question. I see you mention 3D game, generally speaking most people use XNA or DirectX to handle that. However, I suggest that if english is not your native language, to post your question in your native tonge so that we may be able to help you a bit better.

    Sincerely,

            -David


    If you found my post helpful, please give me a recognition point on the left hand side of my post.

    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    Monday, November 26, 2012 3:34 AM
  • David,

    Please ignore this user; he has been abusing the forum for the past three days:

    http://social.msdn.microsoft.com/Profile/abdu%20rahman/activity


    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    Monday, November 26, 2012 3:38 AM
  • If i am able to create more than 3 dimensional game , I can create an amazing game having time and other dimensional holes.

    Allow time to reverse.

    Hi Abdu,

    Can you explain what is the 4D,5D,6D game?

    You question is like "I can go to nearest park on foot, how can I go to the moon, sun on foot?"

    No one can answer you question. 


    No code, No fact.

    Monday, November 26, 2012 6:22 AM
  • Hy Pieter,

    David,

    Please ignore this user; he has been abusing the forum for the past three days:

    http://social.msdn.microsoft.com/Profile/abdu%20rahman/activity


    +1

    Bye.


    Monday, November 26, 2012 7:19 AM
  • Hi Abdu,

    Thanks for you post.

    There are no specific answers to your issue. It seems will be more suitable to be a discussion. I’d like to change the type of your thread to Discussion.

    Sorry for any inconvenience and have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, November 28, 2012 8:42 AM
  • I believe this is what you're looking for:

    Option Strict On
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim DimensionCount As Integer = 6
            Dim Game6D As New MultiDimensionalGame(DimensionCount)
            Game6D.StartGame()
        End Sub
    End Class
    Public Class MultiDimensionalGame
        Public Dimensions As Integer
        Sub New(ByVal Dimensions As Integer)
            Me.Dimensions = Dimensions
        End Sub
        Sub StartGame()
            MsgBox("You have correctly configured your " & Dimensions.ToString & "d game.")
        End Sub
    End Class


    If you want something you've never had, you need to do something you've never done.

    Everyone(not just the thread starter) should take the time to mark helpful posts, propose answers, and mark answers to questions.

    Wednesday, November 28, 2012 8:55 AM
  • I believe this is what you're looking for:

    Option Strict On
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim DimensionCount As Integer = 6
            Dim Game6D As New MultiDimensionalGame(DimensionCount)
            Game6D.StartGame()
        End Sub
    End Class
    Public Class MultiDimensionalGame
        Public Dimensions As Integer
        Sub New(ByVal Dimensions As Integer)
            Me.Dimensions = Dimensions
        End Sub
        Sub StartGame()
            MsgBox("You have correctly configured your " & Dimensions.ToString & "d game.")
        End Sub
    End Class


    If you want something you've never had, you need to do something you've never done.

    Everyone(not just the thread starter) should take the time to mark helpful posts, propose answers, and mark answers to questions.



    Allow time to reverse.

    Thursday, November 29, 2012 1:27 PM
  • Great! I'm so glad I could help.

    If you want something you've never had, you need to do something you've never done.

    Everyone should take the time to mark helpful posts and propose answers!

    Answer an interesting question?
    Create a wiki article about it!

    My Technet Wiki Articles

    Friday, November 30, 2012 4:05 PM
  • http://msdn.microsoft.com/en-us/library/2z08e49e(v=vs.71).aspx

    Saturday, December 1, 2012 5:17 PM
  • if this error occurs then there is no reference or no import to the IO.File class

    http://msdn.microsoft.com/en-US/library/system.io.file(v=vs.110).aspx

    Versions are not always complete equal for this part of handling the code.

    Therefore check that in version 2012, the easiest way is to put in top of your code.

    Import System.Io
    Be aware that although you show up in this forum to be a child younger than 10 does it not mean you should not behave like a real programmer.


    Success
    Cor


    • Edited by Cor Ligthert Monday, December 3, 2012 9:01 AM
    • Proposed as answer by Mark Liu-lxf Wednesday, December 5, 2012 5:55 AM
    • Unmarked as answer by Mark Liu-lxf Friday, December 7, 2012 7:16 AM
    • Marked as answer by Mark Liu-lxf Friday, December 7, 2012 7:16 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:29 AM
    • Unmarked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    • Marked as answer by Abdu Rahman Saturday, June 6, 2015 6:30 AM
    Monday, December 3, 2012 8:59 AM