I have this code for checking if 1 file exists (binPath is already declared):
Dim filename1 As String = "OpenSim.Grid.UserServer.exe"
Dim U As Boolean = System.IO.File.Exists(binPath + filename1)
If U = False Then[code]....
However, I need to check if another five files exist too. Should I just copy the above code another 5 times, or is there a more efficient way of doing it?
I know all about File.Exists in VB. I know that it should work, but in my situation, it is not. Currently our site builds an image string based on the user id, then goes to our image folder on the server and retrieves it. If the image doesn't exist, it displays the broken image icon. I tried implementing the File.Exists method using the path and image name it was already using to pull the file. Even if the file exists, if returns false. I have read other posts saying that it could be a security issue, but it seems to me that if it can pull the image, it should be able to check and see if it exists. [Code]
I have created a class in a vb 2008 project let say project_1 and class_1
I create a second project project_2.
In project_2 I want to use the class_1 I already create in project_1, so I press on add existing item and I add class_1 to project_2. (so far so good)
I double click on class_1 from proeject_2 and make some changes on it and I save the changes, when I double click on the class_1 from project_1 I discover that the it has the old state and the changes I made is not there, I know later that when I press on add existing item, it take a copy of the class and create a new file in the project directory.
Making a system to check for files existing in a network (for our tv address system, pawn shop stuff)Anyway, the command1 checks if d1.txt exists, then d2.txt and fills out the boxes, Instead of 10000 if statements?
Below is example of my current code
Private Sub Command1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Command1.Click If My.Computer.FileSystem.FileExists(Text1.Text + "d1.txt") Then d1.Checked = True
[code]....
Basically it's a bunch of check boxes, that check if the corrosponding file exists
I can add a folder in the setup/deployment project and it gets added when my project is installed. when I do it by writing code, I get a message "access is denied", but the programme will continue to work. I eventually worked out that I had to right click the exe file (in programfiles) and run as administrator so that the directory is created (as the form loads).
I was wondering if it was possible to check if the file "test.txt" is open? and if so then display a message that the file is in use? My biggest problem is that the file can be opened in notepad, word, excel etc. I have some basic coding, which checks if the file is open - what I am trying to do is check if the file is currently open and if its not in use then proceed with the coding, I have the following coding so far.
Dim Process() As Process = System.Diagnostics.Process.GetProcessesByName("notepad") Dim Process2() As Process = System.Diagnostics.Process.GetProcessesByName("word") For Each p As Process In Process
I have added reference to few dlls in my VB.net Project. When I check into Visual source safe and get latest version from another machine, VS.net 2008 throws errors.I have to add the references again in that new machine. Is there anyway where I can keep the references in spite of files checked in to VSS?I need to send copy all the files to production server and we don't have VS.net on the production box to add reference and build the application.
Unless someone knows of a way to do this already in windows, what's the best method for (using a background worker) checking all of the files & subfolders in a folder against another folder in an external usb hdd?
I'd like it to copy only the files that's changed since the last backup, and it'd be nice if I could right-click on a folder (which i can easily google this one, it's a common thing) and select my program and it'd pop up a window to get the destination (since the source is known from the windows context menu) and only copy (overwriting the existing files/folders) that've changed since the last backup.
i am writing a vb.net program which gets a c program as an input and checks it for errors,now i want my program to skip the comments in the c program,i have written some code but its not working
For Each line In TextBox1.Lines sample = TextBox1.Lines(k) Dim len As String len = sample.Length
Basically, I have a list of dates in a SQL table with some statistics next to each of them. I want to compare the dates in the table with a certain date I choose. However, my dates in my table are stored as Varchar(50) (and have to be). Apparently I can convert the date in the table into date type but I don't know. Does anyone know how? My current code can be seen below.
I have a form which contains a checkbox field. On page load I want to create a separate checkbox for each customer in my Database. The code I have to create the checkboxes for each customer works fine. However, I also want to check in the database if the customer is set to unauthorized if they are then I want to check there box. I also have code for the case where the user checks a box. If a box is checked I update the database setting the unauthorized attribute to true. My problem is when I check a box it works fine and the box is checked, however if I reload the page all the boxes are unchecked. So either my database update is not updating the database or the way I check on page load for checked boxes is incorrect. Any ideas?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim sql As String = "SELECT Name, unauthorized, ID FROM Customer ORDER BY Name" Dim dt As DataTable = db.execDataTableQuery(sql, "Customer")
I am trying to check whether a row is getting inserted into my database. It is throwing an error even when it does insert (it's a database issue that will get resolved later when I get a newer version of Microsoft Access), so I can't check whether the insert is successful based on whether there's an error or not. I think I need to check the AffectedRows of something, but I'm not sure what. I've been looking for info on how to do this but I can't figure out how to make it work for my exact situation. Here's a general idea of what my code looks like:
Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
[Code]...
But the numInserted is coming out as 0 every time even though the insert is successful. It may have to do with the fact that myIns1.ExecuteNonQuery() throws an error even though the insert is successful.
-EDIT- I discovered that the "duplicate values" error is because it is somehow attempting to insert the record twice. I have no idea why it's doing that though.
The following line of code gives a warning with Resharper: 'Comparison of floating point numbers with equality operator. Possible loss of precision while rounding values.'
Dim samples() As Single If samples(i) = Nothing Then samples(i) = _mPreviousSamples(i) End If
What is the best way of checking if a value is present?
I am trying to figure out how to check a string can contain a certain value.In the begining I had a checkbox and wanted to hide a ceratin field depending upon which checkboxes were selected.The problem with this is that the value is always = to the first value.
I got around this by writing these values into a hidden textBox and using a loop.So now I have a textbox and if the user selected the 1st and 3rd choice the textBox would = "AC" If they selected all choices it would = ABCD etc...How can I determine if the values in my textBox contains just letter 'B' ?
I tried this:
-------------------------- Dim values As String = [String].Empty For Each item As ListItem In section2List.Items If item.Selected Then
I've been wondering how to do that for a while. (I never really needed it so far ). I wanna make e.g. a simple alarm script (waits for 6.30 am and makes a beep). The only way I could think of it is make a loop in the main function which loops until 8 hours later. Is there any other, more civilized way (probably event?)
How do I check which functions are in a dll I don't who's contents are unknown to me? I am looking to use a certain function and I have a couple of dlls and I don't know in which one it is are its name. So i need to be able to show all function available in a dll and their parameters.
In my application i have set a reference to an activeX component that has been written in vb6(that's not important) What i have done is Here (woo my first hyperlink i hope it works lol) But this is neither here nor there, what i would like to do is put a check to see if the object that has been assigned the activeX component has been assigned it. What i can think of is:If myObject Is Not Nothing Then'set some other stuff End If
The only trouble is, obviously i have an error. Over the Not Nothing I have the following error: 'Is' requires operands that have reference types, but this operand has the value type 'Integer'.Is the type 'Integer' at the end there refering to the Nothing being an integer -1 or 0 and i'm not sure how i would reference the type active x.my question: How can i check if the activeX component is an activeX component and not a whisp of thin air/nothing.
I am trying to make a form that is connected to all my systems at work, this form will not be doing much, it will have an image representing each system, all I want the application to do is if one system is down, the image will turn into red, and if its up, it should be green, to be more clearly and make it simpler, I want it to be linked to more than one destination, each time one link goes down, its image changes to red, and that it. But the problem here is i dont know where to start from, specially that I don't know how to link and get a true or false for the connection!
The following piece of code executes a SELECT query and places the result into a textbox, but if the query returns nothing an error appears saying that there is no value and it won't continue the lines of code after it. (I modified code I found on a website after a Google search, I'm not sure if this is the best way to do it but it seems to do what I want.. so far)
[code]...
How would I change the code so that it checks the query to see if it returns a result? I'm still not too sure what the SqlDataReader can do fully, so I'm not sure if it can check for a result.
what the following code is ment to do is generate a bunch of numbers between 1 and 49 using the while loop to check if two of these numbers are the same. Problem is two numbers are still being generated the same and I know that the numbers generated again will not match them originals so it stops the loop.
i hope to create an application to check vb.net syntaxes (for simple function or methoe). Application will be given richtext box to add function or method and when submit, need to check that vb.net syntax and it will be execute by powershell.
I just want to add a DSN if it does not already exist. I am looking at the registry and I know the DSN exists but this code returns False consistently.If(not isnothing(My.Computer.Registry.CurrentUser.OpenSubKey("SOFTWAREODBCODBC.INISQL_Finance", True)),True, False) Once I get past this the next step is to add the DSN if needed.
Protected Sub updatedata() Dim command As New MySqlCommand("UPDATE company_alert, company_financial SET company_alert.alert_value = (company_financial.receivable * 360 / company_financial.revenue)WHERE company_alert.alert_id='DSO' AND company_alert.stock_code = company_financial.stock_code AND company_alert.year_id = company_financial.year_id AND company_alert.period_id = company_financial.period_id", conn)
[code]....
How am i to do the checking in db that if stock_code already have in the company_alert it will go to insert..
I have some code that will give me a week number, But How can I add to my code for checking if a particular year has 52, or 53, weeks. there is also a leap year to consider, I would like my week number to reset when the new year starts to week Number 01,so here is my code can anyone add to this code for checking the above..[code]
Okay I need two blocks of code for each of these:[code]Now both of these are under the if statements checking if the startsWith or equalsIgnoreCase check boxes are checked. (Only one is under the corresponding code not both.) At runtime when I check off the boxes neither of these two code blocks execute.