Jump to content
Xtreme .Net Talk

Bucky

*Experts*
  • Posts

    803
  • Joined

  • Last visited

Everything posted by Bucky

  1. No, you only need to do this once for the file. After that, the ASP.NET app will have the proper permissions to overwrite the file, since it created the file in the first place.
  2. Ah yes, I've had a lot of trouble with this error. If messing with the user permissions doesn't help, there is another (more awkward) way that works. It seems that permissions won't let you overwrite the file if the ASP.NET didn't create it to begin with. To overcome this, set a breakpoint on the doc.Save line. When this is reached, delete the original file, then continue the code. The new file will be saved, and then it can be overwritten by the app.
  3. Don't even talk to me about Resize event code. :D
  4. The problem there is that DrawImage only takes classes inherited from Image (such as Bitmap) as a parameter; you can't pass a Graphics object to DrawImage. Herein lies the problem. I tried using BitBlt from the DC to the DC of a Bitmap's Graphics object, but without luck.
  5. I have a handle to a window that's been drawn on by various Windows APIs. I can create a Graphics object and paint to it fine. How can I save the contents of the Graphics object (or directly from the hDC, if that makes a difference) to a file?
  6. There are a few things about this VB6 snippet that should be pointed out. 1.) Control arrays are no longer supported in VB.NET like they were in VB6, so you cannot loop like this. It's also a very redundant loop statement, because you're accessing the Index of an Image control whose Index you already know. 2.) The use of GoTo is not acceptable to use in this way; a subroutine should be created to handle the code, and then you should call the sub. That being said, I still don't understand what you're trying to accomplish; if you want to draw graphics in VB.NET, look into the System.Drawing namespace, and look at the sticky thread at the top of this forum.
  7. Just to clarify, which DataGrid are you referring to, the Web control or the Windows control?
  8. In that case, create a boolean variable that can be accessed from both forms. When the parent form closes, set the boolean value to true. In the child form, check the value of the boolean variable, and if it's true then unload the form. You'll also probably want to set the variable back to false after closing the form.
  9. Sounds like a plan; put the identifier number in the file name and then you can check if it exists before loading it.
  10. Bucky

    Sending Email

    Look into the System.Web.Mail namespace: [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebMail.htm[/mshelp]
  11. solus, you are currently not overriding the base class method you mentioned, you just made a subroutine. You need to either: a.) Change the sub name to OnClosing and add the override keyword, and change the parameters, like this: private override void OnClosing(System.ComponentModel.CancelEventArgs e) { e.Cancel = true; } or... b.) Make sure that the current sub is a delegate of the Closing event.
  12. It's impossible, or nearly so; that's the point. Hashes cannot be decrypted. They only go one way, so when the user enters a password, a hash is created, then compared to the hash that's stored. This quote comes from an MD5 hash page: From another page:
  13. If you want to override these methods, you need to inherit the Form first, because they are Protected methods. I think, however, that you're referring to the Form's events. In this case, inside the code window in VS.NET there are two dropdown menus at the top of the window. The first lets you choose a control (choose "(Base Class Events)"), and then the other dropdown lets you choose the event. An event handler will be created for you.
  14. I think what he's looking for is a way to strip out HTML tags from a string. There is an article here about how to accomplish the task. Granted the article is for classic ASP, but the Regexp class works similarly in the .NET framework.
  15. If the Chart control (I'm assuming it's a 3rd-party control) is a Web control, then you can't use it in a Windows Forms project. They are two totally separate entities.
  16. If you just want to resize it, then you can do so with the DrawImage method of any Graphics class. Create a new Bitmap class of the new size you want. Then create a Graphics class that is set by using Graphics.FromImage, passing the new Bitmap as a parameter to FromImage. Then use the DrawImage metho of the Graphics object to draw the original Bitmap onto the new one one, with a Rectangle of the size of the new image. The DrawImage method automatically resizes the image.
  17. I see what you mean, but how will VS.NET know when to start debugging the code? When I set a breakpoint in the code, the red circle has a little question mark and it says that no symbols are loaded. Also, the code and compiled DLLs both on the local HD.
  18. I have a class that implements an Interface, and a Windows app that compiles the code file at runtime and loads it into a class instance. In this way, I can change the code while the app is running. The only downside is that conventional VS.NET debugging techniques do not work; I can't step through the code, check variable values, etc. The only method I have to debug at the moment is a Debug event that I raise whenver I want to return the value of a variable, but the debugging is very frustrating. How can I have a dynamically-compiled and loaded DLL and still be able to debug it "normally"? Or maybe there's an easier method of debugging?
  19. So, did that solve your problem? :confused:
  20. I'm no DB expert, but it looks like you have some multi-line characters in the connection string, which are taken literally as a string when enclosed in quotes. Also, you don't need the concatenation operator (&) to combine two constant strings (their values are hard-coded). That being said, try this on for size: Dim con_str1 As New OleDbConnection("Provider = Microsft.Jet.OLEDB.4.0;Data Source = C:\data\database.mdb")
  21. Bucky

    Delegate?

    [mshelp]ms-help://MS.VSCC/MS.MSDNVS/csref/html/vcrefTheDelegateType.htm[/mshelp] A delegate is used if you want to pass a specific function as a parameter to another function, and then that delegate will be used within the function called. In other words, you can create many functions with the same signature that do different things (string parsing, for example), and then pass one of those to ANOTHER function so that it is called. Sorry if that's confusing... look at the examples given in the MS help for a better idea.
  22. This is a function, so you need to Return True to indicate that the key was handled. Your If statement should look like this: If keyData = keyData.Enter Then MessageBox.Show(keyData) ' keyData is 13 13 when ENTER is pressed on ComboBox Me.SelectNextControl(ctl, True, True, True, True) Return True End If
  23. How can a circular or elliptical gradient (or a portion of an ellipse or circle) be drawn within a Rectangle? I'm thinking it can be achieved with a PathGradientBrush and a certain GraphicsPath, but I'm not sure exactly how. [edit]Boy, do I feel dumb... five seconds after posting this I found the answer in the help files. :o For future reference: [mshelp]ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/_gdiplus_creating_a_path_gradient_usecsharp.htm[/mshelp][/edit]
  24. Okay... did you try the code above? What were the results?
  25. You're using several different varibles here, some of which I don't see declared. What is rm? From what I see, this looks like more along the lines of what you want. You need to declare tree to say how many elements it will hold, and then set the values of the InputBox calls to that array. Dim flower As String Dim tree(2) As String ' Declare an array with a length of 3 Dim m As Integer ' What is this for? It will always be 0 Dim sw As IO.StreamWriter = IO.File.AppendText("words.txt") tree(0) = InputBox("Please enter English Word" ) tree(1) = InputBox("Please enter French Word" ) tree(2) = InputBox("Please enter German Word" ) flower = Join(tree, ",") sw.WriteLine(flower) sw.Close()
×
×
  • Create New...