Jump to content
Xtreme .Net Talk

Raven76

Members
  • Posts

    6
  • Joined

  • Last visited

Raven76's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. try this instead... Private Sub rere(ByVal t As String) t ="after" End Sub
  2. I think you are confused on the use of the timer. You have the right idea, but your missing slightly. Timer1.Interval = TextBox3.Text 'Time inbetween refreshing (time for page to load) In the code above you have set the timer to raise an event at the specified interval once it is enabled. So far so good. Timer1.Enabled = True 'Start the timer Now you have enbled the timer to raise it's event at each interval. Still doing good. AxWebBrowser1.Refresh() 'Refresh the page This causes the refresh, but it's in the wrong place. You need to have it in a seperate sub that is triggered by the Timer1 event. For example: In the declarations section: Private m_iCounter as integer = 0 'Counter variable. Sub #1 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'Set timer properties and start running. Timer1.Interval = TextBox3.Text 'Time inbetween refreshing (time for page to load) Timer1.Enabled = True 'Start the timer End Sub Sub #2 Private Sub Timer1_EVENTNAME() 'Replace "EVENTNAME" with the real event trigger name which I can't remember. 'runs this code whenever timer fires If m_intCounter <= CInt(Textbox2.Text) Then 'If counter less than textbox... AxWebBrowser1.Refresh() '...Refresh the page... m_intCounter + 1 '...and add to counter... Else Timer1.enabled = False '...Otherwise, Stop timer... m_intCounter = 0 '...and reset counter. End If End Sub This is just example code and is untested. Hope this helps. Good luck.
  3. I think he needs it to be more dynamic than that. For example they might only type 1 argument and not both. You could use InStr to find the location of the "." then add 3 to the location to include the file extention. Everything else would be the aruguments. However, If a very diverse set of commands is going to be used in the textbox I could see where some problems may arrise (such as file names with more than one dot). You might be better off with 2 textboxes. The first for the path to the executable (You could even use an openfiledialog to let the user browse to the file and populate the textbox). The second to any optional arguments that the user would like to add.
  4. Since you are storing program settings, you might be better off saving to either an .ini or .xml file. Both of these formats have a predefined structure for storing such data as well as prebuild methods for reading/writing/editing that data in .NET. By saving data in your own format you might be reinventing the wheel. The registry is also an option although I personally don't like using the registry to store trivial program specific info.
  5. You could also give the ASP.NET user delete access to the directory where the file is being written in case the copied file is getting its permissions from the directory above it (so they would have read, write, and delete access to files in that directory). Just don't give execute access and write access to the same files.
  6. Normally when you copy a file from an NTFS partition to the same NTFS partition the permissions are duplicated. However, your code is not trying to delete the same file that it is copying. Maybe this is intended or just a typo, but the two lines of code seem to be unrelated. System.IO.File.Copy("C:\Program Files\My Program\Temp\temp.txt", "C:\temp2.txt") ^This code creates "C:\temp2.txt" which should have the same permissions as the original file. System.IO.File.Delete("C:\Program Files\My Program\Temp\temp2.txt") ^This code tries to delete a different file than the one mentioned above. Therefore "C:\Program Files\My Program\Temp\temp2.txt" may not have the same permissions as the original file you did the copy on. Make sense?
×
×
  • Create New...