VS 2005 To Shorten This Line Of Code?
Mar 31, 2010If xtn <> ".bmp" And xtn <> ".jpg" And xtn <> ".jpeg" And xtn <> ".png" And xtn <> ".gif" Then
I am getting a feel that there should an better way to do this
If xtn <> ".bmp" And xtn <> ".jpg" And xtn <> ".jpeg" And xtn <> ".png" And xtn <> ".gif" Then
I am getting a feel that there should an better way to do this
This is the code that i would like shortenning, it uses a progress bar and a label that counts down with it: I'm using the language of VB..[code]
View 1 RepliesIs there a way to shorten the code below?
Like example:
from weeklbl1 to weeklbl4
location = new point ()
[code].....
I am making a project for school with visual basic and its a mcdonalds ordering system.There are 50+ buttons which you can press to remove an item and my code works fine. only problem is it is waaaaayyyy to long and can be shortened with a wildcard. Does anyone know what a good way to put a wildcard in the following code would be:
Private Sub btnsmallfries_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsmallfries.Click
If Label2.Text = "Buy Mode" Then
[code].....
I want a textbox to be checked for specific characters. I can use: with textbox1.text If .contains("a") or .contains("b") or .contains("c")...etc... then...
View 7 RepliesI have this string just down loaded of a Unix server. I would like to remove the box (0x0A) Unix end line code; then replace it with CR+LF normal ASCII code. Also, I would like to do the replace before I save the data, while it in memory.
View 14 RepliesI have some code which addes values into the items and subitems, which works fine.
vb.net
Case "Aa en Hunze"
Dim Lvi00 As New ListViewItem(New String() {"naam", "blabla"})
Dim Lvi01 As New ListViewItem(New String() {"adres", "blabla"})
Dim Lvi02 As New ListViewItem(New String() {"postc/plaats", "blabla"})
[Code]...
<%
Dim i As Integer
Dim isNow = DatePart("yyyy", Now)
[code].....
I am trying to make a long line of code apear on more then one line.How do I make this:
Do Until Counter1 >= Wash1
Into this:
Do Until Counter1
[code].....
I am using the given code to copy my database files...it works like a charm in debug mode but as soon as I create a setup, it stops working. The error is
"Database Detach Failed"
I tried checking the code line by line and found that the code does not enter the IF block.I have no idea why.
Public Sub bk()
Try
Dim strDatabasePath As String = My.Computer.FileSystem.CombinePath(My.Application.Info.DirectoryPath, "LIC.mdf")[code].....
Is there a way to show the line number of the line of code that caused an exception within a Try...Catch block?
View 5 RepliesI am using WebBrowser1.DocumentText to get a websites source code, and then parse a string. I am trying to view the source line by line, and doing it as follows:
[Code]...
However what is displayed is each character from the source code, rather than the line. I am making the client log into a website, and the needed value from the source code is then parsed, so I need to use the WebBrowser type to get the source code.
show me a simple code for downloading a file from internet with a URL,Line by Line with streamreader?
View 6 RepliesHow do i load a specific or a couple of line(not full file) to a RichTextBox by its line no...
For Example if i want load line 14...
Or sometime line 14-18...
You would think a search for this would show some results but I have had no luck.If I want to delete a line by a line number from a text file, how do I do that?
View 6 RepliesIf anybody is having code for comparing files line by line using vb.net.
View 2 RepliesI'm trying to make this cleaner... I know there's lots of shortcuts for If statements, but I don't know what's best.
If item.RecurrenceId > 0 Then
xmlTextWriter.WriteElementString("recordtype", "2")
ElseIf IsNothing(item.OngoingEndDate) = False Then
xmlTextWriter.WriteElementString("recordtype", "1")
Else
xmlTextWriter.WriteElementString("recordtype", "0")
End If
Question: How to shorten this array creation ? I need to create an array of type ReportingService2005_WebService.Property with one property.
Something like:
Dim PropertyArray() as new ReportingService2005_WebService.Property(1)
I have to do this:
Dim PropertyArray As ReportingService2005_WebService.Property() = New ReportingService2005_WebService.Property(0) {}
PropertyArray(0) = New ReportingService2005_WebService.Property
[Code].....
Dim num as integer = 1.60285253
Msgbox(shorted num??)
I want msgbox to show only shorted version of that number, so It should give 1.06
And is is possible to make it round third number to higer? If I want limit it to 2 numbers only, it should show 1.06 as 1.1, but if number was 1.04 it shows shortened number as 1.0.
I have a function which generates a very large Integer (I do this by using Biginteger from vjslib.dll and I am able to operate all kind of arithmetic operators on such a biginteger.) But, My goal is to shorten this big integer into a small integer. Is there any algorithm? or a mathematical Formula which I can use to represent it in a small integer and use some reverse formula to get the original Big integer?
The big integer my function creates goes like this:
98761210112313489375987956157462364864823458794572 34573485683465868234568613123749081377932457923457 93475897836587236458678234568234658362458762347895 68932456892346578636123846715376123475745723645666 38247687346128346812364812364816341384612384678345 76341236412783461278346781236481263489126348971238 41134681273467812364789
I do not want to represent my bigInteger in a higher base as it will not be possible to do conversion into higher bases with such a large integer.
Im working a lot with normal strings and during my development process strings with lengts of 10.000+ characters are being processes which makes it a my application run slower.Is it possible to shorten the length of any of string, in a way in which it also can be reversed?
View 16 RepliesI am trying to use this code to shorten words like Hello to Hi, and Whats up to sup in a rich text box.
If Value.Contains("Hello") Then
Value.Replace("Hello", "Hi")
End If
End Sub
I am a C# programmer but dabbling in VB.Net because everybody else in my team uses it. In the interests of professional development I would like to shrink the following If... Else... statement.
If cmd.Parameters("@whenUpdated").Equals(DBNull.Value) Then
item.WhenUpdated = Nothing
Else
item.WhenUpdated = cmd.Parameters("@whenUpdated").Value
End If
I have a combo box that has a drop down list with long values in the drop down
Ex:
LB - Pounds
GR - Grams
When the user selects on of the values I want to just show the Abreviaqtions and not the descriptions. So when the drop down is shown it shows
LB - Pounds
GR - Grams
When the user selects "GR - Grams" from the drop down list "GR" is the only this shown in the combobox. I've tried TextChange,SelectedIndexChange and SelectedValueChange but I can't get them to work.
I'm sort of repeating the same steps. There's got to be a way to shorten it.I was able to shorten it before by making a generic function to create the radio buttons.This is the before the rewrite
Public Sub LoadPanels(ByVal tblClient As DataTable)
Dim count As Integer = 20
Dim tooltip As New ToolTip
Dim countName As Integer = 0
[Code]...
I am a beginner and i have a simple question. How can i run code in VB.NET line by line?
Here is an example Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
When i click the button the text "Start" will be displayed in TextBox1 only after the whole event has finished, after the webpage is loaded in RichTextBox1. What i need is the text in TextBox1 displayed before it starts downloading the webpage in RichTextBox1.
For example, this:
var Data = new Array(new Array("ASDFGG", "asd_10377142_keyword", 9, 42285017, 10377142, 1), new Array(""ASDFGP", "asd_10377149_keyword",", 9, 42284844, 10377163, 1)... and so on
As you can see, I only need the digits right before the _keyword
I want this action to be on the button click.
How would you convert this line of VB6 code to VB.NET 2005
HTML
sblock = StrConv(System.Text.UnicodeEncoding.Unicode.GetString(byteArr), vbUnicode)
ystem.Diagnostics.Process.Start("F:VBMedia RipperMedia RipperinReleaseconvert.bat"This line in the bat file does not execute?
View 1 Replieswhenever we go to code by double clicking on some control so we saw a body of two lines:
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
end sub