I have found the following code which can get the harddisk no in VB6.0.I would like to translate it into vb.net code.I have tried the auto upgrade function in vb2005 and translated the following code to vb.net, but the outcome did not run probably.Can anyone give me some help to translate the following VB6.0 code into vb.net code?
I have put together some code to login to one of my websites [code] The problem is when i display the sites source code it still shows the source of the login page, rather than the page you goto once you login
Issue: Can't find a way to utilize process.start to enable automatic login to various websites.Program: A simple window form application with a desired module/form to store user passwords and websites and launch a login from the form (a very basic "password manager" and launch) Side-issue: Data storage (Not yet explored because of inability to solve main issue) , would like to use text file to store System.Security.SecureString data-type.
Narrative: I'm really new to all of this but not lazy or unwilling to do the work. Two and-half months of no less than 14 hours per day reading and applying myself to VB language and VS IDE. Been able to solve all my own problems thus far with help of Web or my $600 library investment, and have a working app that I've been able to deploy. However, neither of these assets seems to hold answer for this problem, and unlike others I've encountered, I can't find a work-around.
Potential Answers: It seems that answers may lie within an HTML/XML/JS/AJAX get/post route, but this is an entire new area of study/research that I hope to avoid if there is indeed an answer utilizing Process.Start. There also seems to be a potential to solve my problem using ASP.NET, or using System.Windows.Browser and HTMLElementCollection (for the last I've only found snippets of code that utilize My.Settings.UserName, & My.Settings.Password, and it is unclear to me if these settings reflect the login to user machine or to actual desired site).
My Hope: (which may be forlorn) is that there is a simple explanation on how to plug a value in to the last parameter of Process. Start ---"Domain". I'm assuming Domain is not what I would normally interpret to be the root of a website, but is instead particular to user machine. I've found no good examples, other than a hint of using System.Configuration.ConfigurationManager, and statements that old VBCode made access easy.
My Assumption: I'm thinking this is another area where my newbie status has made me a believer there's a solution within my grasp before I found the answer but after I made a commitment. VS2008 fooled me in a similar manner in three other areas thus far, the PrintDialog control duped me into thinking printing was an easy process, HelpProvider control had me totlally convinced that Help installation was a snap, and OneClick deceived me into believing deployment was oh so simple.
Process.Start may be another place I've been had, but if you speak pretty good newbie Anyway, here's the small bit of code I've been playing with but without luck (Win32 exception, parameters are incorrect:)
I need to translate line 4 in the code snippet below into VB. For some reason I cannot get this done tonight. I am either too tired or having a brain drain.[code]
I have a hashing method whose operations depend on input to the function. Profiling the program has shown that too much time is spent evaluating this hash method. I want to try changing it into an expression tree, so the inner loop checks can be done once.
Here is a simplified version of the function (I undid some obvious optimizations for the example, and took out any input validation):
Private Function Checksum(ByVal inputValues As IEnumerable(Of UInt32), ByVal declarations As IEnumerable(Of String), ByVal statements As IEnumerable(Of String)) As UInt32 Dim variables = New Dictionary(Of Char, UInt32)
[code]....
I want to create a function which takes the declarations and statements and outputs a specialized expression tree representing a function which takes an IEnumerable of UInt32 and returns a UInt32.Follow-Up:I succeeded, and the speed-up was ridiculous (an order of magnitude). The main things I had to learn where:Use Expression.Lambda and Expression.Compile to get a delegate you can actually use.The Expression.Block factory method has a 'variables' parameter you (essentially) use to declare locals.Expression.lambda has 'parameters'.If you call Expression.Parameter twice, you're dealing with two different variables (even if their name is the same)! Store the result for later usage. Same for labels, etc.The result of a BlockExpression is the last expression in the block.
I have a line of C# code and can't translate it correctly. 'myString' is a string and 'a' and 'k' are both UInt:a += (uint)(myString[k + 0] + (myString[k + 1] << 8) + (myString[k + 2] << 16) + (myString[k + 3] << 24)); Translators for VB suggest the following but I get "Operator '<<' is not defined for types 'Char' and 'Integer': a += CUInt(myString(k + 0) + (myString(k + 1) << 8) + (myString(k + 2) << 16) + (myString(k + 3) << 24))
I have this working on VB6 that saves a query in a excel sheet:
[Code]...
The XLSNombre is a variable with the name of the excel file that has been set before. The connection I have in .NET is to SQL server (but is the same). How can I use this code (or..how can I make this code work for .NET) or what is the equivalent of this for .NET? I found some solutions but with inserts of single rows or I have to set the title of the columns, I dont find any "simple" solution to do an "insert into" (like the code I use in VB6).
I came accross the code below in a book. I prefer displaying my data in Winforms instead of the Console which the boook uses but I have little understanding of console codes and how to convert them to Winforms.[code]....
the "text", such as that you would find in a forum, and use it in a Visual Basic Windows Form.Everything in bold is finishedGrab theHTML source of a web page and store it into a string variable.Next I need to search that string variable for two HTML syntax, and place the text between them into another string variable
I found this code to check internet connection on MSDN, but I am getting errors on the part of the code in bold, saying they have not been declared. how to declare these two things? I mean 'InternetGetConnectedState' and 'Flags'?[code]...
Suppose I have two buttons btnCheck and btnOK. I want to execute few lines code of btnCheck from btnOK. So that When I click on btnOK, btnOK's code as well as BtnCheck's Code should be executed one after the other. How can I do this in vb.net
I'm wondering if it's possible to refresh only a part of a code, the reason why is that I'm adding an item from Form2 to a listbox in Form1.The code in Form2 for adding is : [code]I need to press a button in Form2 to trigger the refresh in the code I posted above + it needs to do this action.[code]
I want to display only the number in this link, in a label visual basic 2008 this is the code i have, it works it just displays the whole link in the label.
Dim theElementCollection As HtmlElementCollection = Me.WebBrowser1.Document.GetElementsByTagName("a") For Each curElement As HtmlElement In theElementCollection Dim ctrlID As String = curElement.GetAttribute("innerText").ToString
I have a HTML file (for example filename.html) with a HTML code (div, paragraph, ecc...) and HTML Table.I need extract only HTML TABLE from source and conver it into XML datafile.[code]...
I've got a DateTimePicker control on my form. The normal behavior is for it to allow the user to "move" between value fields with the arrow keys and remember the last date part that was highlighted when the control loses focus. Then, when the control gets focus again, that date part is highlighted. We all know this, I'm sure.What I want to know is how to access the control's selection properties/methods in order to have my DateTimePicker control always highlight the month portion when a user enters the control, regardless of what the last date part highlighted was.
try 'code goes here catch ex as exception end try next
now, in my code, i also have if ex = certain error. i'd like it to go back to the top of the try. reason for not letting it do its thing is, i am wanting it to retry it, under the same item. So, is there a way to goto a portion of the code.
I have created a class which generates a form in code. I have hooked up the buttons and a text box so that they work. Now, I am trying to hook up the Resize event (and probably will need other events) for this form. How do I do that? If I can understand how to do it for the Resize event, I should be able to apply that to whatever other events I might want to use. I can't just put "Handles frmMyForm.Resize" or "Handles Me.Resize". I get the message "Handles clause requires a WithEvents variable defined in the containing type or one of its base types." This all has been a learning experience.
I have a BIG piece of code that looks like this: Public Sub mnuNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuNew.Click ' Lots of code End Sub I need to execute this subroutine from another part of the same form's code. This should be fairly simple but I haven't been able to figure it out. How do I do this?
Is it possible to create a code that when a button is clicked it Print Screens part of the form (For example, location 3,4 to location 30,40) and then saves the image?
i was trying to make a free microsoft word plugin in vb.net. It automatically fills a web form. The main problem with the plugin is that it uses web browser control and once it has filled a form it will need to navigate another form. The form can only be filled once it has completely been loaded.so my approach is
1. navigate to first site when form loads
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate("http://google.com") End Sub
2. use an integer i and use if statements to check which form to fill :
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs) Handles WebBrowser1.DocumentCompleted If (i = 1) Then[code].....
3. this is the main step. you see when main form loads, i=1 so browser goes to google.com (first form), when form is completely loaded, itchecks for value of i. Since i=1, it fills google. After filling and continuing i=2 and browser goes to my personal account page. This means browser again loads the document. Now i=2, so it fills my personal detalis. Now the timer starts. Since i=3, browser navigates to second site and fills the details.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If (i = 3) Then WebBrowser1.Navigate("http://blogger.com")[code]...
now the problem arises. The browser does not go to the third site. Once the timer has been stopped and started, the following code does not goto the elseif part (i.e. i=5) why is that so?
im making an application in vb.net (duh!) anyway i have created and coded the whole project and it performs exactly as i want it to (i dont need code help). my problem lies with the fact that my project is 2-3 parts
1.a setup form that gathers inital data about the enviroment stores this data encrypted in a config file. after inital setup this form is not displayed again. but needs to be run on both computers
2. the second form is the real application form im in the process of turning this part in to a background service anyway this form is the one that establishes the connection between two nodes it works correctly
3. the config files
anyway here is my problem i want to make this application distributional with just one file the (.exe) and have this .exe make everything else happen. it runs the setup form and creates the first config file which it does then it needs to produce a copy of just the second form and the config file to transfer to workstation #2 that will run independtly without the whole application which i cant make happen then it needs to turn both workstations application on by only starting one on either computer and invoke the other computer to start its corrosponding app also no idea how to make this happen any ideas or suggestions as to where to look to try to find my answers.im thinking i might need to make two seperate applications (a setup app, and the running app) and include them both in a project and use the setup.exe to to package them together this is a little side project that im making for my self to use to make programming a little easier so i plan on giving it out to some fellow students to test and tell me what they think so im not really worried about ease of use or complicated procedures yet but if it turns out to work and actually be of use to anyone else i would be willing to rewrite it to distribute to the masses but for now i just want it to work for me.
my requirement is that i have to count occurrence of a certain date and between two months suppose i have 10-jan-2012 now i have a date range 1-jan-2012 between 1-feb-2013 my requirement is that if i find 10-jan between 1-jan-2012 between 1-feb-2013 irrespective of year i know that 10-jan will come twice between 1-jan-2012 between 1-feb-2013 i am not understanding how to do this.i meanto say that i have to compare only day and month part of the date which will solve my problem