vb.net

EnableCors for VB.net

江枫思渺然 提交于 2021-02-10 09:41:48
问题 Does anyone know how to put the enableCors into the controller on vb.net. i am working along with a pluralsight course and tried a code translator with no luck. my attempt is below. <EnableCors(origins: "http://localhost:53080", headers: "*", methods: "*")> 回答1: The correct syntax would be something like this: <EnableCors("http://localhost:53080", "*","*")> The C# example appears to use named parameters. VB.NET supports that too, however the EnableCorsAttributes has properties and contractor

EnableCors for VB.net

瘦欲@ 提交于 2021-02-10 09:41:21
问题 Does anyone know how to put the enableCors into the controller on vb.net. i am working along with a pluralsight course and tried a code translator with no luck. my attempt is below. <EnableCors(origins: "http://localhost:53080", headers: "*", methods: "*")> 回答1: The correct syntax would be something like this: <EnableCors("http://localhost:53080", "*","*")> The C# example appears to use named parameters. VB.NET supports that too, however the EnableCorsAttributes has properties and contractor

TextFieldParser throws a MalformedLineException on a (seemingly) well-formed CSV line (error text doesn't seem to apply)

这一生的挚爱 提交于 2021-02-10 06:57:32
问题 I have some pretty typical code to parse a CSV file using a Microsoft.VisualBasic.FileIO.TextFieldParser : using (TextFieldParser parser = new TextFieldParser(new StringReader(jobsReport))) { parser.SetDelimiters(","); parser.HasFieldsEnclosedInQuotes = true; string[] headers = parser.ReadFields(); while (!parser.EndOfData) { // ERROR OCCURS HERE string[] fields = parser.ReadFields(); // ... } } However, I get the following exception: Microsoft.VisualBasic.FileIO.MalformedLineException: Line

Printing barcode using vb.net class

限于喜欢 提交于 2021-02-10 06:47:18
问题 I just want that the barcode will print the value of txt_betamount.Text , for example, when i input 100 it will create a barcode and it will print it, In my case what ever i inputted in txt_betamount.Text the barcode automatic like static print the 123456789012 i don't know where it comes from. I have this class that generate a String and Photobox.Image in my Activity and I have this code in my form that calls this Print Class. Imports IDAutomation.Windows.Forms.LinearBarCode Public Class

FIXED A bug in FontSize function in Visual Basic while developing an office suite

一笑奈何 提交于 2021-02-10 06:12:51
问题 After faffing around with the FontSize function for hours, I am stuck upon a piece code. The font list, whenever I want to define that each font has the same size, it automatically scales it up to 72. I have browsed the Internet to find out how to get a font list, that worked, but when I added a fontSize to sizecombo combobox it went all berserk. Imports System.Drawing.Text Public Class wordking Dim fontSize As Integer = 8 Private Sub wordking_Load(sender As Object, e As EventArgs) Handles

how to get list all buttons in all forms of the project

醉酒当歌 提交于 2021-02-10 05:34:29
问题 I have the next code to get all forms in the project in vb.net. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim myAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly() Dim types As Type() = myAssembly.GetTypes() For Each t As Type In types If UCase(t.BaseType.ToString) = "SYSTEM.WINDOWS.FORMS.FORM" Then MessageBox.Show(t.Name) End If Next End Sub how to get a list of all buttons in all project's form? 回答1: Here is how

Checking for new files in a folder

♀尐吖头ヾ 提交于 2021-02-10 05:33:08
问题 I need to monitor a folder to see when new files are created and then have the file processed and then archived. Its the actual detecting of new files i'm struggling with...I understand that I need to be looking at the FileSystemWatcher thing, but was wondering if anyone knows of any examples of its usage in this way to get me started? Say my folder is "C:\Temp\", I need to know as soon as any file with a ".dat" extension appear. Sorry for the vague question, I just havent been able to find

Checking for new files in a folder

血红的双手。 提交于 2021-02-10 05:32:30
问题 I need to monitor a folder to see when new files are created and then have the file processed and then archived. Its the actual detecting of new files i'm struggling with...I understand that I need to be looking at the FileSystemWatcher thing, but was wondering if anyone knows of any examples of its usage in this way to get me started? Say my folder is "C:\Temp\", I need to know as soon as any file with a ".dat" extension appear. Sorry for the vague question, I just havent been able to find

Regex to match only numbers in currency

自作多情 提交于 2021-02-10 05:15:08
问题 I'm trying to get a VB regex to match only the numbers in a currency sequence without additional substitution lines if possible. It needs to look for a number with + on end $ at the start and return what's in the middle, minus any commas. Accordingly $10,000+ match returns 10000 $20,000+ match returns 20000 $30,000+ match returns 30000 $1,000,000+ match returns 1000000 $10,000 (anything without the trailing +) should *not* match I can easily get the match to the value but I can't figure out

System.Net.IPAddress returning weird addresses

别等时光非礼了梦想. 提交于 2021-02-10 03:52:38
问题 I am writing a (rather simple :) networking application, and am testing it using localhost:27488 ( 127.0.0.1:27488 ). I am using a System.Net.Sockets.TcpClient for the connection, which takes a System.Net.IPAddress to specify the host... the only thing is, I can't figure out how to initialize the class with the right IP address. I went over the MSDN docs and it says it takes either a Byte(4) or an Int64 ( long ) for the address. The probelm is, when I initialize the IPAddress like this: Dim