vb.net

Use .wid files with Visual Studio 2017

风格不统一 提交于 2021-02-08 03:06:04
问题 I have created a Setup Project with Visual Studio 2017 Professional ( .vdproj file ). I would like to use a Password Dialog as suggested in this page: https://www.codeproject.com/Tips/659367/Password-Dialog-for-Visual-Studio-Deployment-Proje This tutorial has been written for Visual Studio 2012 and it's working great, putting the file VsdUsernamePasswordDlg.wid into this folder: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\Deployment\VsdDialogs\1033" But I can't find the

Use .wid files with Visual Studio 2017

橙三吉。 提交于 2021-02-08 03:05:52
问题 I have created a Setup Project with Visual Studio 2017 Professional ( .vdproj file ). I would like to use a Password Dialog as suggested in this page: https://www.codeproject.com/Tips/659367/Password-Dialog-for-Visual-Studio-Deployment-Proje This tutorial has been written for Visual Studio 2012 and it's working great, putting the file VsdUsernamePasswordDlg.wid into this folder: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\Deployment\VsdDialogs\1033" But I can't find the

How can I get the seed from a Random already created

早过忘川 提交于 2021-02-07 23:15:04
问题 I have to be able to repeat an experiment made with my code, it makes a few random numbers and I need to get the initialization value of my new random() sentence. I have this sentence to make the random object I use Dim r As Random = New Random() As I have read it gets the initialization value from system datetime. If the experiment were successfull I'd needed to be able to repeat it. How could I get the initialization number to be able to do: Dim r As Random = New Random

How can I get the seed from a Random already created

£可爱£侵袭症+ 提交于 2021-02-07 23:14:03
问题 I have to be able to repeat an experiment made with my code, it makes a few random numbers and I need to get the initialization value of my new random() sentence. I have this sentence to make the random object I use Dim r As Random = New Random() As I have read it gets the initialization value from system datetime. If the experiment were successfull I'd needed to be able to repeat it. How could I get the initialization number to be able to do: Dim r As Random = New Random

Access a form's control by name

时光毁灭记忆、已成空白 提交于 2021-02-07 22:46:19
问题 not sure whether the title of this post is accurate. I'm trying to access windows form controls and their properties by "composing" their name within a loop, but I can't seem to find the related documentation. Using VB.net. Basically, say I have the following: Dim myDt As New DataTable Dim row As DataRow = myDt.NewRow() row.Item("col01") = Me.label01.Text row.Item("col02") = Me.label02.Text '... row.Item("colN") = Me.labelN.Text I'd like to write a for loop instead of N separate instructions.

There is no row at position 0

自古美人都是妖i 提交于 2021-02-07 20:22:03
问题 cmd.CommandText = "select * from product where prod_code='" & Trim(txtprod_code.Text) & "' and branch='" & w_location & "' and avail_stock <>" & (0) & "" cmd.CommandType = CommandType.Text con.Open() da_uqc.SelectCommand = cmd cmd.Connection = con da_uqc.Fill(ds_uqc) m_qty = ds_uqc.Tables(0).Rows(0)(4) 'error da_uqc.Dispose() ds_uqc.Dispose() cmd.Dispose() Is it possible to give like this m_qty = ds_uqc.Tables(0).Rows(0)(4) ? 回答1: You're getting a run-time error denoting that there was no

How to change font size without creating a new font

ⅰ亾dé卋堺 提交于 2021-02-07 18:47:02
问题 Is it possible to change the size of a font in .net winforms without having to create a new Font with the new size? 回答1: No. Font size is readonly for existing "Font" objects. 回答2: You could do something like this with an Extension method. Imports System.Runtime.CompilerServices Module FontExtensions <Extension()> Public Function ToSize(ByVal OriginalFont As Font, ByVal NewSize As Single) As Font Dim NewFont As Font NewFont = New Font(OriginalFont.FontFamily, NewSize, OriginalFont.Style)

How to change font size without creating a new font

帅比萌擦擦* 提交于 2021-02-07 18:46:28
问题 Is it possible to change the size of a font in .net winforms without having to create a new Font with the new size? 回答1: No. Font size is readonly for existing "Font" objects. 回答2: You could do something like this with an Extension method. Imports System.Runtime.CompilerServices Module FontExtensions <Extension()> Public Function ToSize(ByVal OriginalFont As Font, ByVal NewSize As Single) As Font Dim NewFont As Font NewFont = New Font(OriginalFont.FontFamily, NewSize, OriginalFont.Style)

Is possible to create a generic list of named tuples in Visual Basic?

北城余情 提交于 2021-02-07 13:23:37
问题 In C# (7+) I can declare (Better naming in Tuple classes than "Item1", "Item2") var myList = new List<(int first, int second)>(); and later on refer to items: var a = myList[0].second; Is there an equivalent syntax in VB.NET? Edit From Andrew Morton's answer, the equivalent syntax is: Dim myList = New List(Of (first As Integer, second As Integer)) Dim a = myList(0).second 回答1: Yes, see Tuples (Visual Basic). Dim q As New List(Of (EventDate As Date, Name As String, IsHoliday As Boolean)) q.Add

How to create directory on FTP server

烂漫一生 提交于 2021-02-07 09:29:40
问题 I am using the following code for creating the folder on FTP server ; But its not working in my case :- Dim sFilePath as string =filepath Dim ftpResponse1 As FtpWebResponse Dim ftpRequest1 As FtpWebRequest Dim IsExists1 As Boolean = True ftpRequest1 = CType(FtpWebRequest.Create(sFilePath), FtpWebRequest) ftpRequest1.UseBinary = True ftpRequest1.Credentials = New NetworkCredential(ZXFTPUSER, ZXFTPPASS) ftpRequest1.UsePassive = True ftpRequest1.Method = WebRequestMethods.Ftp.MakeDirectory