Jump to content
Xtreme .Net Talk

mooman_fl

Avatar/Signature
  • Posts

    194
  • Joined

  • Last visited

Everything posted by mooman_fl

  1. My favorite is an old one... a Z-80 editor/assembler and disassembler written in TRS-80 Model III BASIC. My second place one was a drawing program that I wrote on the same computer in Z-80 machine code. I used the memory utility (can't remember the name now) to write the program directly to memory then dump into a file. I had figured out the file format of the CMD (equivalent to an EXE) file so it could be executed normally. This was of course before I made my editor/assembler.
  2. Thanks... I will try that and post the results. In absence of a working solution I had moved forward in the app by "hijacking" the form elements from the application. It works, but I could drasticly reduce the amount of code needed by being able to just compose a POST and Navigate the page.
  3. If it helps, here is the relevant code from the webpage's login form: <form method="post" action="http://www.drudge.com/log-in"> Username: <input tabindex="2" id="username" name="username" value=""> Password: <input tabindex="3" id="password" name="password" type="password" value=""> <input type="submit" name="command" value="Log In"> </form> Any help on this would be greatly appreciated.
  4. Did some research on this and found what I think I was looking for. Unfortunately I can't seem to get it to work. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim username As String = txtUsername.Text Dim password As String = txtPassword.Text Dim postdata As Byte() = System.Text.Encoding.ASCII.GetBytes("username=" + username + "&password=" + password) WebBrowser1.Navigate("http://www.drudge.com/log-in", "", postdata, "Content-Type:application/x-www-form-urlencoded" + [size=2]vbCrLf[/size]) End Sub P.S. - Sorry, I tried to use the VB tags instead of the CODE tags, but it kept screwing up the formatting and putting everything on one line.
  5. I am working on an application that has a webbrowser control and a textbox. The particular page that the browser points to is a blog that has a submit form on it to post a reply to the particular thread. Replys are submitted via post, but the text editor on the page is sorely lacking in features. The application I am making needs to be able to take text from the custom editor in my application and submit it through the webbrowser via a POST command. IS there a way to accomplish this?
  6. Difficult to do under setups where you are behind a router/gateway. I finally "cheated" by making a PHP webpage that simply returns the IP address of the vistor to the page. This seemed to be the only realistic way to do it. Hopefully in the future router/gateways will have a common WAN IP return call that can be made. Kind of doubt that though.
  7. This may be a silly question, but did you try putting a link to your backup utility program in the Start folder? Or making a registry entry in one of the Run folders? Edit: NM I thought about it and answered my own question. Start and run work when you log in. Never tried making a service so unfortunately I won't be much of a help.
  8. Welcome! If you have questions, ask away.... after you have done a diligent search of course.
  9. I am getting you correctly you are saying that you have both C# and VB in the same project. Not in separate assemblies. If this is the case I don't believe you can mix them like that. You will either have to convert the C# to VB or vice versa.
  10. Thanks Marble_eater! While your example as you were pointing out doesn't exactly suit my needs you did answer a few questions for me. I feared that it was too messy or unprofessional to serialize the design-time path although I really didn't see a way around that. Just in case the specifics help, this was part of a property in a control. You specify the interface library dll and it will pull a reference to the interfaces out and put them in a collection for access later by the functions that search plugin dlls for matching interfaces. Indeed, relative path is desirable at run-time... but design-time seems to be a bit more of a sticky wicket. Seems that MS should have included a method that can be used to determine the path to the current projects directory, or at least the build directory. Would make things alot easier in controls like this since that is often very useful info. If anyone has any more suggestions I am willing to listen, extra helpful suggestions could net a free, licensed copy of the control when it is done.
  11. Thanks for the reply. I will experiment a bit with your suggestions a bit to see how they can clean things up a bit. However I am still stuck with the problem of the paths being very different at design-time as opposed to run-time. This problem, as outlined in my previous two points is the one I really need addressed.
  12. Looks like what I may have to do is keep the original Value passed back from the FileNameEditor Dialog and the check to see if the control is in Designtime or Runtime. If it is runtime then I will programmatically strip the path and substitute it with the Application.StartupPath. This just seems a little messy to me because then you have a path in the executable that points to a spot on the programmers drive. I don't like that. On a slightly different note I did find the way to determine if you are in DesignMode or not... it returns True if you are and errors out if you aren't but a Try/Catch fixes that: [size=2][/size][size=2][color=#0000ff]Try [/color][/size][size=2][color=black]Windows.Forms.MessageBox.Show[/color][color=black]([/color][/size][size=2][color=#800000]"DesignMode = "[/color][/size][size=2] [color=black]+[/color] [/size][size=2][color=#0000ff]Me[/color][/size][size=2].[color=black]Site.DesignMode.ToString)[/color] [/size][size=2][color=#0000ff]Catch[/color][/size][size=2] [color=black]ex[/color] [/size][size=2][color=#0000ff]As[/color][/size][size=2] [color=black]Exception[/color] [color=black]Windows.Forms.MessageBox.Show([/color][/size][size=2][color=#800000]"DesignMode = False"[/color][/size][size=2][color=black])[/color] [/size][size=2][color=#0000ff]End[/color][/size][size=2] [/size][size=2][color=#0000ff]Try [/color][/size] What is the general consensus? Is the method I mention a bit messy or should it be ok? Any suggestions on alternative methods?
  13. I have done variations on this question before and never really did get the problem sorted. I am making a component that has a collection class as a property. Among the properties in this class is a filename string that should point to an interface library in the containing program's folder. It also has a second, nested, collection class as a property. When the filepath is set it looks at the interface library and retrieves the interface names listed in the library. My initial problem was that the path in the filename string was set by a FindFile dialog, and it set an absolute path serialized in the control to the project directory. This would not do for the end-user at runtime however. I fixed this to just serialize the filename without the path. I did this by using this logic in the "set" for the property: [size=2][color=#008000]'Value is the path and filename returned by the FileNameEditor dialog [/color][/size][size=2][color=#0000ff]Set[/color][/size][size=2]([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] [color=black]Value[/color] [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]String[/color][/size][size=2]) [/size][size=2][color=#008000]'Regex determines if the value returned is a complete path. [/color][/size][size=2][color=#008000]'The only time the path should be complete is when the property [/color][/size][size=2][color=#008000]'is set by the FileNameEditor. If it is set at runtime via the [/color][/size][size=2][color=#008000]'serialized value, it will be filename only minus the path. [/color][/size][size=2][color=#0000ff]If[/color][/size][size=2] [color=blue]System.Text.RegularExpressions.Regex.IsMatch[/color][color=black](Value,[/color] [/size][size=2][color=#800000]"^[a-zA-Z]:\\.*\..*"[/color][/size][size=2][color=black])[/color] [/size][size=2][color=#0000ff]Then [/color][/size][size=2][color=#008000]'This retrieves the filename from the complete path. [/color][/size][size=2][color=black]FileName =[/color] [color=blue]System.IO.Path.GetFileName[/color][color=black](Value)[/color] [/size][size=2][color=#0000ff]Else [/color][/size] [size=2][color=#008000] [/color][/size][size=2][color=black]FileName =[/color] [color=blue]System.Windows.Forms.Application.StartupPath[/color] [color=black]+[/color] [/size][size=2][color=#800000]"\"[/color][/size][size=2] [color=black]+ Value[/color] [/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If[/color][/size] This works fine during runtime and designtime. The problem comes in the next statements during designtime... [size=2][color=#008000]'Loads the assembly and looks through it for interfaces. [/color][/size][size=2][color=#0000ff]Dim[/color][/size][size=2] [color=black]aASM[/color] [/size][size=2][color=#0000ff]As[/color][/size][size=2] [color=black]System.Reflection.Assembly[/color] [/size][size=2][color=#008000]'load interface carrying DLL [/color][/size][size=2][color=black]aASM =[/color] [color=blue]System.Reflection.Assembly.LoadFile[/color][color=black](FileName)[/color] [/size] At designtime FileName winds up giving a "file not found" error when you try to go to Design View for the containing form. Turns out the it is putting the path of the DLL as the path to the VS.NET folder. I know WHY it is doing this... just not sure what I should do to get more acceptable behavior. Is there possible a way just to programmatically get a path to the component library dll itself? Or maybe to get the path to the project directory programmatically at design time?
  14. Not ugly... in this case it would be practical. It avoids having to pause your main thread thereby negating the purpose of running that routine at that time in a separate thread. Otherwise, just call the routine in the main thread. Either way the result is the same... the main thread will have to wait for the action to complete before it will do anything else.
  15. Hadn't read that article before, but read a few like it. I agree also. I wasn't attempting to make a foolproof program, just a more difficult one. Just because it isn't easy to obfuscate your methods in .NET doesn't mean you need to serve it on a silver platter. :p All in all, I am not worried about most people getting ahold of my code. But I just don't want to make it easy on them to do so. If I can make them lose more than two hairs in frustration when they try, I feel I have accomplished my purpose. ;) The assembly isn't going to be world shattering, just extremely useful to project developers. It is a plugin manager control. Drop it on your form, set a few properties, like plugin directory, and interface libraries, and it will load your plugins AND provide a plugin manager control that you can add to your program. You will be able to have managed and unmanaged plugins. That simply means that plugins that use the built in IPlugInfo interface will be managed, those that don't won't be managed by the manager. Managed plugins can have startup properties set (start at runtime, etc) so the end user of the program can decide which ones they want running. Unmanaged plugins will always run at runtime and don't show in the manager at all, so that is good for core application code. The overall goal is to provide a reusuable control that will make plugins a simple operation for the developer.
  16. Thanks PlausiblyDamp and all that have answered. I supposed I better get a little more general AND a little more specific, and explain what I am wanting to do and why. What I was trying to do is find a way that I can shut down a program without having to use the standard programmatic methods for reasons of obfuscation. Just throwing an exception of course will not do it, and I have come to realize that. My concern is disassembly of my product... it would be easy to search in MSIL code or even reconstituted VB/C# .Net for the standard methods of shutting down programmatically, and then remove them. My thought, although erroneous, was using an error (i.e. a sneaky divide-by-zero) to cause an exception, pass my custom message saying they didn't have the right registration info, then let the exception shut it down. One of the things I realized though in testing after I posted, was that: At least the common exceptions like that don't shut down the program as they used to even if uncaught. Even injecting your custom message will result in a very unprofessional looking exception dialog. It just plain isn't going to work. That being said, I would be open to any suggestions that might accomplish the goal of shutting down the program or DLL assembly without easily traced and removed code. Personally though I am beginning to think that this is going to be just an instance of "nothing you can really do". Seems that intellectual property security is not a big advantage and actually more of a liability with .NET
  17. I have to ask... why not just clear the dataset in the thread that uses it? This would save the hassle since you know that you only want the dataset cleared AFTER it is used. The point of threads is that they run simultaneously. Having the one thread pause while waiting on the second thread to finish defeats the purpose of threads to begin with.
  18. I already know how to throw an exception with a custom message. I also know how to try/catch exceptions. What I need is a little different. I need to be able to catch an exception ONLY to pass a message to the user via a messagebox then let the normal handling of the exception continue (i.e. shutting down the program). I don't want to have to shut down the program programmatically. Is this possible? I have a sneaking suspicion it might involve subclassing the System.Exception class to make a custom exception routine. Hoping there might be a slightly easier way.
  19. Very informative! Thanks! Wasn't having rbulphs problems, but the info is about to come in very handy anyway.
  20. This is a known problem with the Tabcontrol. Disable visual styles for your application, or use Buttons for tab style. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=8377&SiteID=1
  21. I don't think game controlers use them anymore... but I know they are still sometimes used for midi. Don't know about soundcards carrying them... but my Asus A8N Deluxe mobo has a midi/gameport built onto it. No idea how to access them programatically though... sorry.
  22. Thanks for that explaination. I wasn't aware of the finer points of those types of statements and I am sure that bit of knowledge will come in very handy later. :D
  23. I finally ran into something I couldn't translate easily. Maybe one of you can help. EXListViewItem lstvItem = this.GetItemAt(e.X, e.Y) as EXListViewItem; Never seen the "as" keyword used that way in C# before and not sure quite what to do with in in VB
  24. Mandelbrot is correct. Use the "Is" keyword instead of "=". Had to fix the same problem in some code I converted last night and that is what solved it.
×
×
  • Create New...