4 Replies - 741 Views - Last Post: 23 October 2009 - 08:54 PM Rate Topic: -----

#1 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Can you store in program?

Posted 23 October 2009 - 08:36 PM

I have audio files in the directory of my program.. Can I somehow code the audio files within my program? Like they compile within my program and are called from within the program..

Is this what my.resources is for? (I don't know anything about my.resources.. Only my.settings...)

This post has been edited by JohnorSky: 23 October 2009 - 08:37 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Can you store in program?

#2 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1004
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: Can you store in program?

Posted 23 October 2009 - 08:38 PM

You can add them as Resources to your application, then access them via Properties.Resources.[resourcename].

I've never used the VB.NET layout for Visual Studio, but in C# simply right click the Project name in the Solution Explorer (down the right), click [ProjectName] Properties, choose the Resources tab, choose the file type and click "Add Existing File..." :)
Was This Post Helpful? 0
  • +
  • -

#3 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Re: Can you store in program?

Posted 23 October 2009 - 08:41 PM

View PostRudiVisser, on 23 Oct, 2009 - 07:38 PM, said:

You can add them as Resources to your application, then access them via Properties.Resources.[resourcename].

I've never used the VB.NET layout for Visual Studio, but in C# simply right click the Project name in the Solution Explorer (down the right), click [ProjectName] Properties, choose the Resources tab, choose the file type and click "Add Existing File..." :)



Oooh.. Awesome so that is what my.resources is for?

I'm currently reading this: http://visualbasic.a.../a/ResVBNET.htm - to help me understand it better..

omg this is awesome..

This post has been edited by JohnorSky: 23 October 2009 - 08:46 PM

Was This Post Helpful? 0
  • +
  • -

#4 RudiVisser  Icon User is offline

  • .. does not guess solutions
  • member icon

Reputation: 1004
  • View blog
  • Posts: 3,562
  • Joined: 05-June 09

Re: Can you store in program?

Posted 23 October 2009 - 08:49 PM

Exactly, but you shouldn't need to touch that.

Like I say, just try Project Properties, there's a GUI to modify what files you include in the application rather than editing the resources file directly.

If you're talking about My.Resources from a code perspective, maybe - I don't do VB :) Try it! :)
Was This Post Helpful? 0
  • +
  • -

#5 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Re: Can you store in program?

Posted 23 October 2009 - 08:54 PM

View PostRudiVisser, on 23 Oct, 2009 - 07:49 PM, said:

Exactly, but you shouldn't need to touch that.

Like I say, just try Project Properties, there's a GUI to modify what files you include in the application rather than editing the resources file directly.

If you're talking about My.Resources from a code perspective, maybe - I don't do VB :) Try it! :)



Oh snap... this did it: My.Computer.Audio.Play(My.Resources.alert, AudioPlayMode.Background)

wow that's really cool... and definately not any where near as difficult as i had imagined... vb got a lot easier from vb6 to vb.net...

This post has been edited by JohnorSky: 23 October 2009 - 08:58 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1