Understanding When To Use Classes - Return The Information Back To Form1?
Aug 16, 2010
I have such a bad habbit of cramming all my code into one form. But i dont know when i should write a class. or dont really understand how to return the information back to form1. when should i even use a class? for example i have some code here
[Code]...
View 10 Replies
ADVERTISEMENT
Feb 29, 2012
I remember seeing somewhere on the net that there are classes in .Net that will return information about your computer. I know that System.Environment returns some of this information like MachineName and some other stuff. Are there other classes that will return information such as hard drive size, free and used space, total memory, used memory?
View 4 Replies
Oct 27, 2009
In my window application, Form1 variable eg. Public str as string. value blank/null when move to Form2 and Back to Form1. How to maintain Form1 varable's value when back to Form1 In vb.net if any one know, reply me soon
View 2 Replies
Feb 20, 2011
I'm using webclient to download a webpage but obviously since it's on the UI thread it freezes.How can i change my class to be multi threaded using DownloadStringAsync? i can do this normally but since i am needing to return the information back to the UI thread i am a bit stuck
Public Class RequestExecutableInformation
Public Function FileReport(ByVal executable As String, ByVal ParameterStart As String, ByVal ParameterFinish As String) As String
Dim Source As String = String.Empty[code]...
View 6 Replies
Apr 8, 2010
I need to be able to start with Form1, move to LoginForm, then back to Form1 taking 2 variables and the "values" they have in the LoginForm back to Form1 and using the variables. I start with the main form (Form1) and have the user enter some information. Once they click OK I have the LoginForm open. After they enter their credentials I will check to make sure they are legal users, then go back to Form1 (here is where I need to take the Username and Password with me) to log onto a server using the same credentails from the login form.
View 1 Replies
Dec 12, 2009
i have form1 in vs2008, i would like to have a button where users can click it and the colorpicker pops up, like in photoshop or MSword where you select the text then pick the color.
if this it to complicated than i can have 4 radiobuttons that each one is accosiated wiht a color, is theree a way to make the radiobutton diferent color than white( NOT THE BACKGROUND COLOR)the circle inside.
View 9 Replies
Aug 27, 2009
I am using VB2005 and trying to put an application together.What it needs to do is retrieve information from a binary file, possibly alter that information, and put it back into a new file.The file is a .wav file with data appened to the end. There is an additional section at the end of the .wav file which stores xml data.I have found that if I open this in a hex editor and make a 1:1 swap on any of the bytes that the application that the file is for can still read the XML.If I tried to add or remove characters from the XML then it would not read. I located a header byte and incremented it to resolve this.
This worked as an excellent bandage to do conversions where the data always needed to be changed to the same thing.What I have been asked to do is build logic that allows for different things to happen depending upon what data is contained within the file.The method that I am currently trying to impliment is:
Read through the file with a system.io.binaryreader
Searche for a bytestream that will signal data is coming
For example:
If System.IO.File.Exists("C: est estread.wav") Then
Dim findit() As Integer = New Integer() {&H3C, &H55, &H73, &H72, &H44, &H65, &H66, &H30, &H31, &H30}
Dim i As Integer[code].....
And then extract all the data till the end of element marker "<" It seemed like there should be a better way and I was looking for some insight. If I proceed with this method, I will have to read the file one time to gather the information and then a second time to write it all out with the header modified for length.This is my first experiene with working with binary files in this way.Also,I've been experiementing with building a string and slapping it back in at the end using the binarywriter.write(string) method.I noticed that it was putting in header characters before the string.These seem to change if I change the length of the string.At one point it was d0 07. Later it became e7 07. Does anyone know of a way to prevent this header from being inserted?
I tried a for each loop to grab all of the characters from the string, convert them to a byte array and deposit the byte array into the file, but the header remained the same. When I write the byte array generated from a system.io.binaryreader I do not get this header.
View 1 Replies
Jun 9, 2011
Someone told me that i should stick with method #2, form2 has an id that form1 passes in order to load information from.
method #1
CODE:
method # 2
CODE:
View 7 Replies
May 12, 2010
I need to provide a DLL that is consumed by a VBA app (Access 2003, late binding) and returns stuff that is retrieved from various WebServices. These WebServices publish methods that not only return a single object, but also arrays of them.
From the Access-app's point of view, it's no problem to consume i.e. an array of strings. However, there's also methods that return an array of a (proprietary) class. I can't seem to be able to consume such an array from VBA.[code]....
View 2 Replies
Apr 2, 2012
I have a serializable Message class that has a Data As Object property that I'm using as a generic holder for information to be sent via a system that uses a combination of push technology and/or IPC to communicate with any other programs that are interested in the information. This allows the communication piece to be agnostic of the information it transmits.
I was serializing this Data As Object as a Byte[], since I was worried about how an Object being serialized and transmitted across the network would behave on the other side. However, when deserializing I get errors about being unable to find the assembly for the types stored within my Data As Object property, because I'm deserializing in the assembly that contains the Message class... not the assembly that contains the type that Data As Object originally was.I was wondering if I'd lose the type information and be unable to cast it back to the type I want at the other end. Perhaps it's not possible to pass a type as an Object via another assembly without it knowing about my type?
View 2 Replies
Apr 10, 2012
I have two Parser classes that inherit from a base class, BaseParser. I want to use either class as a parameter in another Monitor class. The Parser classes, CS600 and TCH600, both have two properties, RawDataList and SummaryDataList. The CS600 class's RawDataList returns a List(of CS600Data); the TCH600 RawDataList returns a List(of TCH600Data). The SummaryDataList returns similar classes in each Parser class. CS600Data and TCH600Data derive from a base class, BaseData.BaseParser also has RawDataList (List(of BaseData)) and SummaryDataList (List(of BaseSummaryData))The Monitor class has a private field, _thisParser which can be either of the two concrete Parsers above. I want to be able to call and use RawDataList and SummaryDataList of _thisParser within Monitor class, but when I construct the concrete Parser classes, Visual Studio notes that the RawDataList property of CS600 cannot override the RawDataList property of the BaseParser because they differ in their return types.
I thought that since CS600Data derived from BaseData (but also adds some new properties of its own) that I could use CS600Data wherever I use BaseData. What am I misunderstanding? How can I correctly construct these classes?
Public MustInherit Class BaseParser
Protected _rawDataList As List(Of RawGasData.BaseData)
Public MustOverride ReadOnly Property RawDataList() As List(Of RawGasData.BaseData)
[code]....
View 1 Replies
Aug 18, 2011
We are developing a webservice for a client. We are not supose to throw SoapExceptions, so instead, we catch every exception server side, and return a custom Exception class.
Public Class Order
...
End Class
[Code]....
The problem now is, that since my webmethod is returning the type [Object]. The wdsl that is generated does not contain the order, or the exception.
I can change the [Object] to [Order] Or [MyException], but only one of them is generated in the wsdl.
I want both the MyException type and the Order type in my wsdl, but i just cant get it working.
View 2 Replies
Dec 10, 2011
I have a parent class that is also a factory. For example:
Public Class Factory
Public Function clone() as Factory
' Some logic here
[code].....
View 2 Replies
Jun 15, 2009
Is there anyway you can send information back to the original creator of the program? Here is a quick example- I made a little program that gives you general information about your computer, when you click a button it sets the text box to specific information. One of the text boxes gives you the Version of your OS. I would like to know if there is a way to send the information in that text box back to me when someone clicks it and they are connected to the internet. FYI I would tell the person who clicks it before so that I am not stealing information, plus what is there to steal from a simple program I made.
View 2 Replies
Aug 17, 2010
Is it possible to slowly Increment a progress bar to 100 and then return the value back to zero. I was thinking of using a timer but i'm not sure were to start.
View 7 Replies
May 18, 2010
Basically my program creates a text file based on whatever is contained in the 6 list boxes. What i need it to do is load the text it created back into the relevant list box. text file looks like...
Consignment Number-----Shippment Method------Expected Departure Date
CC33-1EA------------Express Air-----------18/05/2010
[Code]......
View 10 Replies
Oct 6, 2010
I am in the process of prototyping a small sockets application, which monitors IT infrastructure (due to in-house financial and deployment restrictions, I am unable to utilise an existing commercial or open-source solution). Basically, I have a server application and associated agent process for communicating heart-beat data to the server. The server application implements a TCP socket class (TCPDevice), which is called from a WinForm. I am aware of the restriction on updating the UI from processes running on separate threads, and that the preferred technique for acheiving this is via the use of Delegates in conjunction with the Invoke method. Having had very little need previously for using Delegates (apart from of course std windows events and the BackGroundWorker control), I am at a loss as to how to do this in the context of my application, and would appreciate some assistance, although it has occurred to me that I could use the backgroundworker for marshalling updates to the UI.
Eventually the application will need to update a grid of devices via feeds from the defined agents, however for the purpose of this exercise simply updating a status bar on the UI will suffice. The section of the code which I believe is relevant to propogating the code to the form is contained in the OnDataReceived method.Below is a code excerpt from the protoype app which should put the above into appropriate context:
Code from the form:
[code]...
View 1 Replies
Aug 19, 2009
I've created a simple licensing system for a friend who has created visual basic programs which he sells at a few dollars each (they're speciality programs).The licensing system is coded in PHP (I'm a PHP coder), and the system requires the user to input their license key upon start up, if there is not already an activated key (which is created in a .txt doc)
View 2 Replies
Jul 9, 2011
Trying to find some code to assist with accessing a web service. I am a newbie when it comes to web services and don't quite get the whole how to submit the request and then read the results. I know from searches that people request a copy of the WSDL file so I have attached (SystemManagementService.wsdl)
[Code]...
View 4 Replies
May 20, 2011
I have the following Code so the User can enter their domain before the program runs. The resulting textfile does not output the users..just the word Schema...
EDIT 1: Updated to include all code. I now can run it and it returns a text file that lists
OU=_USERS
OU=_GROUPS
OU=_ETC
ETC ETC
[Code].....
View 2 Replies
Nov 28, 2011
This is annoying. I'm trying to put a wrapper around some functionality that uses a web service to return some information. The intention is to wrap all of that communication into a dll such that the user can simply call functions from the dll to get back information, without needing to care about the service.As far as I can tell, that isn't possible, because the service information, as far as bindings and endpoints, HAS to exist in the app.config of the program that references the dll. That means that anybody using this dll won't just be able to add a reference to it and use it, like they would with any other kind of dll, they must also edit their app.config to add in a bunch of information. That's a simple copy and paste job, but it's incredibly unfriendly, and exposes some of the internal workings of the dll to casual inspection.
View 8 Replies
Jan 31, 2012
Can I connect phone landline to my computer and when someone call me his information appears by his phone number this information already exist in database.. I want to know is it a service from communication company or can i do it by code just plug the cable into my computer ?
View 1 Replies
May 13, 2008
i am using data grid and i want to update it when user change i but the fallowing command in button to save update but it did not work and it give error massage
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(DataAdapter1)
Dim CmdB As New OleDb.OleDbCommandBuilder(DataAdapter1)
DataAdapter1.Update(DataSet1, "Section")
the error messge (Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.)
View 2 Replies
Sep 4, 2009
I have a table Personal.. and bind it in dataset.. i want to update the fname using datatable.. but it is not working ..throwing the error "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."See my source code
[Code]...
View 2 Replies
Dec 31, 2009
i have built a DB app using vs2010Beta2 + an Access DB .mdb file for my customers the save bnt work s ok, but when i close the app i get an error message come up saying :- Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that dose not return any key column information.i have no errors repoted in the error window at the bottom and all runs well untill frm_closing,below is the code in my form closing event. below that is the code for the btnSave event
Private Sub frmMainCustomerDetails_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MyState = "Edit" Or MyState = "Add" Then
[code]....
View 4 Replies
Apr 18, 2009
When this code segment execute
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Validate()
Me.myDA.Update(Me.myDataSet.Tables("Table1"))
Me.myDataSet.AcceptChanges()
End Sub
It giving the following error. Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information. Can there is another way to update the access database by using datagrid view.
View 2 Replies
Sep 9, 2011
Using VB 2008:Situation: A Form1.BackgroundWorker calls a Form1.subroutine. That sub starts a Form1.Timer with Me.tmrOK_BlinkForm.Enabled = True...fires Timer code in event: Public Shared Sub tmrOK_BlinkForm_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrOK_BlinkForm.Tick
Form3.Visible = True
Form3.Label1.Text = gNowButtonDispText
Form3.BackColor = Color.White
Form3.Refresh()
[Code]...
There must be a way to do this, I just need the correct BackgroundWorker Syntax send Stop commad to Form1.Timer from Form3.Click_event...all inside a Form1.BackgroundWorker thread started in Form1.
View 4 Replies
Feb 16, 2009
I have got 2 forms ----- form1 and form2
i wanted to navigate from form1 to form2. and then close form1
i did the following code.
-sub form1 _ page load
dim form as new form2
form.show()
me.close
-end sub
i also tried -- form1.close() and form1.dispose() but all in vain
Problem is that my form1 is not getting closed
View 7 Replies
Jun 12, 2010
I have an aboutbox1 and form1..I also have a button. When I click the button it runs the backgroundworker. My background worker then opens form1.My backgroundworker doesnt just open it, it does alot of other stuff so don't ask why im doing it like that.My problem:When the background worker opens form1, form1 is not responding.
View 3 Replies
Oct 21, 2010
Which different abount Form1.Close and Form1.Dispose?
View 1 Replies