Simple System.Text.RegularExpressions Request?
Jan 10, 2010
after searching for around a half hour or so, I found that the regularexpression API could do what I need.Basically, I needed to only allow letters, numbers, and symbols in my textbox. The problem was, I could stick alt codes in there, even with a keycode case check
View 2 Replies
ADVERTISEMENT
Mar 4, 2011
I have a string which i need to parse using Regex class of System.Text.RegularExpressions. I need to find if the first 2 characters of the string are either "00" or "07" or "16" or "23".
View 1 Replies
Dec 6, 2010
I've been hammering at this over the weekend with no joy - been through page after page of RegEx Language documentation too.It's very easy to negate a match on characters. For example:
Dim MatchString As System.String = "<test0><test0><test1></test1></test0></test0><test0></test0>"
Dim NegationPattern As System.String = "([^<>])"
Dim RepStr As System.String = ""
[code]....
View 1 Replies
Feb 14, 2011
I was wondering if it was possible to colorize syntax of, say HTML, inside of a RichTextBox by comparing each word in the current line of text against the collection of words in System.Web.RegularExpressions.AspCodeRegex? I'd imagine that from this question it would be possible?
View 3 Replies
Dec 27, 2010
I am trying to use an Asynchronous HTTPListener to create a simple web server in VB .Net (Not ASP) This will be run as a desktop application. My only goal is to be able to request Server Variables from the client. Is there any way to do this from within a HTTPListenerWebServer? I am using the code from the MSDN VB .Net Samples:
[Code]...
View 5 Replies
Sep 4, 2009
we are making our program in other computer it runs, without errors, but then when we transfer the program to another computer it has an error that says
An error occurred creating the form. See Exception.InnerException for details.The error is: Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
View 24 Replies
Sep 8, 2010
I wrote a custom assembly for SSRS that returns a jpeg for the background image in a textbox on the report.I followed all instructions on msdn in regards to security but i still receive the same error.
Below is my config information
<pre lang="x-xml"><PermissionSetclass="NamedPermissionSet"
version="1"
name="Barcode">
[code].....
View 6 Replies
Jan 9, 2012
Here is my code:
Dim StartString As String = "Private Sub"
Dim EndString As String = "End Sub"
Dim SearchString As String = StartString & "(.+)" & EndString
[code].....
View 1 Replies
Aug 20, 2009
System.Text.RegularExpressions.Regex.Replace(item.Summary.Text, ????, "")
What would I put in the? to get only the domain from a URL: EG [URL] should turn into "Google".
I don't know how the regex works to make it do that. Would it be like "*/*..*" or something?
View 8 Replies
Jan 23, 2010
[code]Close to no real programming skills (PhotoShop artist turning Visual Basic Beginner)This is a snippit of the code used in my browser. Basically the items that are in the list box are loaded from a text file hidden in the installation directory so a manager (or such) will be able to edit which websites are navigate-able.Here comes the problem though, I have not been able to get it to work correctly it will not block any of the listbox items. If I can remember it will only block the site which is selected.How can I re-code it to make the program block all the items in the listbox instead of just one.(Also if not too much trouble how can I make something that will enable and disable the code)BTW this isn't a commercial program or anything just a project I have been working for ever at home.
View 9 Replies
Jun 21, 2010
i want to create a simple POS system, can you tell me how can i hide group of buttons/ controls on the first load of a form and then group of controls will just show after a button is clicked or selected. Also i want to have a display (on same form) of what is selected by the user.
View 3 Replies
Mar 13, 2009
I am trying to develop a simple inventory system. I now have all the database set up and would like to know if there is any code that I can refer to that alert users when the stock is low (e.g pop out window informing users that stock is low or change the number of stock in the database table into different colors).
View 16 Replies
Mar 30, 2012
I am creating a game which has a simple score system which I don't understand why it isn't working the way I want it to. When loading the game the User starts with 10 credits and for every time they run the game it costs 2 credits
This is my code for this below
Dim intCredits As Integer = 10
Dim intGamesPlayed As Integer = 0
intGamesPlayed += 1
intCredits = intCredits - 2
It has no errors but it doesn't take away the credits each time the game is played besides the first time. So when I run the game it will go to 8 credits, and it will stay on 8 credits even if I run the game again.
View 9 Replies
Jun 21, 2011
How in VB.Net can I extract the value from a string using the RegularExpressions class? For example, say I have the string:[Mon Jan 4 2011] Blah Blah2 Other text and I want to return the "Mon Jan 4 2011" portion in to a variable. I thought you would use the "Regex.Replace" method but I can't seem to figure out how to extract the portion of the string I want.
View 3 Replies
Nov 17, 2010
I'm trying to create a simple user tracking system so whoever has the program open can see who else has the program open. I know how to retrieve the username and everything. What I was doing was updating (loading and saving) a listbox with a text file on the network with the usernames in it. I can't get it to work right and I think its because the simultaneous opening and saving of the same text file by multiple users. I know this isn't technically the best way to go about doing this but it seemed like it should be the easiest. I don't want to make a huge project out of this because it isn't that important, it would just be nice.
View 7 Replies
Mar 30, 2012
I am creating a points system for a game, this is the code I have but it isn't working as I want it to.
Dim intScore As Integer = 10
Dim intNumOfGames As Integer = 0
intNumOfGames += 1
intScore = intScore - 2
The user will start will a score of 10, but everytime they click the button the user should lose 2 points off the score. But my code above that doesn't happen, when the user clicks the button it only happens once leaving the user with 8 points throughout the game.
View 1 Replies
Feb 2, 2009
i know how to make a simple login system but im not sure how to script it. I make a txt stored at a website. And i will open it with a invisible textbox (to login, only username requed). Then when i have a logon screen. And if i write like:"ABCUSER""SUSER"And make a if like: If 'text in login screen' equals line 1 or 2 in invisible textbox, then ...etc
View 14 Replies
Jan 18, 2012
This code hangs in infinite loop. Any ideas why is that? Is that a bug in .NET? Can I do something about it?
Dim urlRegex As New
Regex("((?:[a-z][w-]+:(?:/{1,3}|[a-z0-9%])|wwwd{0,3}[.]|ftp[.]|[a-z0-9.-]+[.][a-z]{2,4}/)(?:[^s()<>]+|(([^s()<>]+|(([^s()<>]+)))*))+(?:(([^s()<>]+|(([^s()<>]+)))*)|[^s`!()
[code].....
View 1 Replies
Nov 3, 2011
Im still a bit newb to coding in Vb but Im trying to figure out how to make a simple inventory system for my video game. I need it to do a few simple things and Ive never made a inventory system before so im a bit lost on how to approach it.
Functions Needed:
Player has 40 pb that act as the visual inventory or display the item in that slot.
[URL]
I set up my armor menu to allow drag an drop of the item but again not sure how to even get the inventory system created to finish the armor menu to allow the object to be dragged into its box and remove its self from the player inventory.I think I need to make a array for 39 or 40 in my adventurestorage class. That part Im pretty certain of but how do I set that part up? I have over 200 images that need to act as a item that can be dropped into the inventory.
View 1 Replies
Mar 7, 2012
can you teach or give me a code for a simple grading system using VB '10..?
View 2 Replies
Aug 14, 2009
I'm trying to run a simple database and im getting a "System.NullReferenceException" error ) & "Additional Information:Object reference not set to an instance of a object" .
txtItemName.Text = rowCurrent.Item("ItemName") <-- highlighted in yellow
Code is as follows:
vb.net
Imports System.Data.OleDB
----------------------------------------------------
Public Class Form1
[code]....
View 2 Replies
Jul 4, 2010
Im trying to make a simple send key system on my project but it dosent send to the window in in why ?
SendKeys.Send(X)
My.Computer.Keyboard.SendKeys(X)
View 11 Replies
Feb 12, 2011
I just finished making a Tetris game in VB.NET, and I wanted to add a high score system to the application. So, when a user completes their game, they have the option of submitting it as a high score, which will compare their score against the previous high scores, then place it accordingly. I was thinking of an XML approach of doing this, where the user's name, rank, score, level, and number of lines cleared will be stored in tags. Here is what I thought the XML might resemble:
[Code]...
So the program will have an array to store all the previous scores. It will read through the XML, and copy the the score data into this array. Then, when the time comes to submit a score, it will compare this score against those previous scores, and find the proper position for that score, and then save it into the array. At the end, it will then copy all the score data from this array to the XML, replacing the <Level>, <Lines>, and <User> tags in the process.I am however having trouble implementing this, as I have no experience with XML files and everything I've read has been very confusing.
View 2 Replies
Mar 4, 2010
I think its better if i attach my files for you understand what i wanted to happen in my program.
We are now in our finals and for our project we need to make a program that shows connection of database(sql or access) and vb.net so dont mind if it has a problem in design or anything bcoz the objective of this project is to show what we've learn in our subject IT Programming 1 (vb.net)
I dont know what to do in this part of my program. what to do first? why is it attaching zip files is not allowed?
View 4 Replies
Dec 23, 2009
I have this Quiz software that lets you create online multiple choice quizzes which are great for studying (I am in grad school and I'm trying to use everything I can to learn). So the Quiz software is great but it only lets you input questions by hand, one by one. I took a look at the .xml file that the quiz program spits out and came up with the idea to try and make a converter so that I can import many questions at once. I was hoping to try and solve this limitation by doing the following:
Take a .doc that say a tutor gives us with a bunch of practice questions, and then take that into Crimson Editor, and then format it so the question is on line 1, the multiple choice answers are on lines 3,4,5, and 6, (for the next question, the question would be on line 11, and the answers on lines 13, 14, 15, and 16, and so on) and then take that saved .txt file into my program, hit the generate button, and it will spit out the .xml file, and then import that into the quiz software to generate the online quiz.
Here is an attached screenshot of my program layout so far:
I figured out how to open a text file by watching simple youtube tutorials, but I don't know how to have it generate the stuff and have it show up in the bottom text box. I know how to do the coding to convert the txt to proper xml code but I don't know how to be able to save the contents of the bottom text window to an xml file.
View 1 Replies
Jul 22, 2009
I am getting an intermittent "System.Web.HttpException: Request timed out." error when my code hits the line response.write():
sMessage = "Searching...0% complete."<br>
sSetVal = "<script>document.getElementById('MessageDiv').innerHTML='" & sMessage & "';</script>"<br>
Response.write(sSetVal)
Note that Response.BufferOutput = false is set when the page first starts executing (well before the above code executes).The code is used to update a progress message while other threads execute long-running processes. One thread runs continuously and checks the status of the other threads. As the other threads finish, this thread outputs updated status messages to the end user. I realise that this could (should) be recoded using ajax, but it is a legacy app and that is not an option at the moment.
This code is run 10,000+ times a day, and the error only occurs about 5 times - so I suspect the response object is being blocked by other threads when the website gets busy. However, I don't know which performance counters to check in the performance monitor. Or is this problem caused by something else? I am using IIS 6, asp.net v2 and vb.net?
View 1 Replies
Jan 23, 2012
I have a form in VS2010, written in VB, and it has a subroutine calling for information out on the web using an httpwebrequest object. It takes a while for the response, and I would like the subroutine to write a message to the form (into a Label) for the user to see while waiting for the application to respond.
I tried writing the message with a Backgroundworker and then as a second thread. I got it to write the message, but it always seems to wait for the http response before writing the text. How do I write the text immediately, while waiting for the data?
View 2 Replies
May 28, 2010
How to develop a 3 tier soution saying this. If you want to make a simple 3 layer system (3tier is for a longtime complete misused by marketing from Microsoft, 3 tier needs something like a Unix computer) However, do this: start a Windows Form project, then do 2 times File -> Add New -> Project -> Class Library while you name one DataLayer and the other BusinessLayer. While the DataLayer project is selected, you do Add New Item and take the Component (give it the name DataBaseHandling). Then while that component is open. In top Data -> and than what you want to select, however create in fact the DataSet and Adapter in that.
Don't forget to set in your main project a reference using Poject -> Project too your two datalayers. It is easy and don't need all those images, those you will see pasing by doing this. Try to avoid to use your DataLayer in your BusinessLayer which is often done, because then those layers make in fact no sence. i am not an expert The bussiness and datalayer in the same solution really? And when he said: "While the DataLayer project is selected, you do Add New Item and take the Component (give it the name DataBaseHandling)." What kind of component should i choose? and what about the presentation layer? how to call one layer to the other,
View 10 Replies
Jul 5, 2010
I have recently started using Request("key") instead of Request.QueryString("key") to access my querystring values. However I have read that:
'Gets the specified object from the System.Web.HttpRequest.Cookies, System.Web.HttpRequest.Form, System.Web.HttpRequest.QueryString, System.Web.HttpRequest.ServerVariables'
Therefore, if I have a querystring key and cookie key which are the same, which value is returned?
View 1 Replies
Dec 6, 2009
basically the user enters phrases into the textboxes, and i use <TAG> in the text so that every time button is clicked the selected text is rewritten including a phrase from the textbox.
View 19 Replies