Jump to content
Xtreme .Net Talk

Slurpee

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by Slurpee

  1. Slurpee

    timer

    hey all, I have knocked up a small app that sits in the system tray until a predifined time is reached (read from an ini file) when it triggers an event. I'm having a little bit of trouble as I currently read the details and loop until the current time matches that of the file, this is obviously processor intensive. I guess I can add thie looping to a new worker thread and that will aid things but there must be a refined way of doing this...anyone good with vb.net?? all advice greatly appreciated.
  2. i've come up with a simple answer to my own question :) anyway instead of the loop I have implementer a timer and it works a treat. Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick ' increment counter Count = (Count + 1) Mod 3 ' load next image PictureBox1.Image = CType(myImage(Count), Image) End Sub
  3. Hey quick question...I've written a little program that grabs local radar images from a web server. The images are updated ever 10 minutes so I want to display the four images I DL until I DL the next four images :) my problem is that the code I've written causes the app to crash every 20~30sec...guess I'm doing something wrong. Anyone have any ideas? My code is below Private Sub LoadImages(ByVal status As Boolean) Dim intX As Integer Dim myImage As ArrayList = New ArrayList() Dim tThread As System.Threading.Thread For intX = 0 To 3 myImage.Add(Image.FromFile(".\images\" & intX & ".gif")) Next intX Do While status = True For intX = 0 To 3 PictureBox1.Location = New System.Drawing.Point(-5, -20) Me.PictureBox1.Image = CType(myImage(intX), bitmap) PictureBox1.Size = PictureBox1.Image.Size System.Threading.Thread.Sleep(1000) PictureBox1.Refresh() Next intX Loop End Sub
  4. cheers I'll try and use that code if I can :) I do have one other question though that someone may be able to answer: Reqest = HttpWebRequest.Create(sURL & Filename & Prefix) if I want to use the above code...where sURL is a URI is there a way to add the filename and prexif to the URI. Sorry if it a basic question but this is day two of web stuff :( Thanx
  5. I've run into a bit of a problem :( I'm trying to download selected files from an arbitrary web page. The image files are to be written to a directory. private local as string = "./images" Dim FileStreamer As New FileStream(local, FileMode.Create) now I have tryed this but I'm getting a error indicatiing that I don't have permission? This is wierd as if I pass in a location to my method the code works fine. Anyone got some advice or a nice reference site?
  6. come on man thats a bit harsh...I answered your question. Why not be more specific nect time and save the confusion :) anyway why not check out the c source for dig on a nix box?
  7. download sam spade :)
  8. I'm new to the random file thing and I'm having a few issues trying to make a simple lotto number generator/analyser. Anyway I'm generating the six random numbers and then sticking this info into an array so I can check for duplicates. Naturally this is the easy bit, I fall into problems when I try and enter this info into my file structure. So anyone got some advice on looping and entering random information into a file structure??? I have done it this way to start the project off: FileOpen(1, "numbers.data", OpenMode.Random, OpenAccess.ReadWrite, OpenShare.Shared, Len(udtLotto)) For count = 1 To 10 udtLotto.first = ran() udtLotto.second = ran() etc... FilePut(1, udtLotto, count) Next count FileClose(1) any advice warmy appreciated :)
  9. ok a quick question. I hava a nested for loop like say for x=0 to 10 for y =0 to 10 if some condition is true array (x+1, y-1)=T AND array (x=2, y-2)=T next y,x is there a way to increment to counters concurently so that i can get rid of the inner conditiuon (which happens to be a lot more complex) I know you can do this in java and C but in VB i'm not sure. Anyone????
  10. http://www.eggheadcafe.com/articles/20030302.asp:D
  11. i actually work it out ;) as I expected it's a really easy fix. Just make a new object refrence to your form: Dim Otherfrm AS New Form2() then change the target of the handler AddHandler GameButton.Click, AddressOf Otherfrm.ClickHandler :)
  12. quick question (I hope) I'm currently making a connect 4 game. To speed things up I decided to write a control array class. This class houses my add-button method and its clickhandler. Now here is my question: in my form I call my class to to generate the buttons necessary for the GUI, now how do I refrence the clickhandler from my form? I need this so that I am able populate my array with the locations the player has chosen. Any advice or links to relavant sources are greatly appreciated.
  13. Thanx for that most excellent advice ;) I'll be finished ina day or two.
  14. Bucky cheers for the reply :) First off yes I'm aware that this code is far from ideal, as I stated I'm very new to vb.net and this is my very first attempt at graphics within this framework. I merely posted this code as I was fortunate enough to find a tutorial online that accomplished the task I'm trying to solve ( a connect 4 game). The use of this loop is simply to populate the control (a 6,7 matrix). I was just curious if this code has a simple equivalent in .net Anyway cheers once again for the reply I'm off to buy another text book that covers graphics in more detail than my prescribed text.
  15. I'm trying to generate a game board for a connect four project. I've look long and hard for info on graphics within dot net but I've had little luck. I was however fortunate enough to com across this solution based on vb6 code. For a = Image1(Index).Index To 42 Step 7 For b = 1 To 7 If LegalMoves(b) = a Then GoTo 300 Next Next now my question is: is this posiable within the .net? as I'm having no luck at the moment :( well I hope someone helps me out soon as I'm off to purchase Deitel&Deitel (the best tech books ever) cheers:D [edit]VB is not PHP[/edit]
×
×
  • Create New...