VB Code For Returning File Properties?
May 24, 2010I been trying to create a database of files. I wanted to list the Titles and Authors of the files.
How can this be done?
I been trying to create a database of files. I wanted to list the Titles and Authors of the files.
How can this be done?
i am starting my job from a VB.net application using VS-2008. In the job i need to accessinsert and modify summery properties. example : this can be worked by windows photo gallery.
View 7 RepliesWhen I click save on the view, the model being sent to the save method of the controller has no values set, they're all default values. I'm actually using the exact same technique from another project... The data is populated just fine in my view, I can edit it and click save, the code enters the SetSiteTerms method in the controller but has none of the data from the view.
Model:
Imports System.ComponentModel.DataAnnotations
Imports System.Runtime.Serialization
<KnownType(GetType(SiteToA))> _
Public Class SiteToA
<ScaffoldColumn(False)> _
Public Property ID As Integer = 0
[Code] .....
I've updated my view and controller. Why my model is populated, can be editing in the view but when I post with the save button, the model sent to the controller has no data???
[code]I want to make the Properties Window to update the properties for X and Y at each MouseMove, so they become immediately visible for the user.
View 2 RepliesI'm working on a Hazardous Materials label printing program. One of the options is to do an "NFPA" label. Since there are 4 values required with 4 or 6 options, the ratings are entered via radio buttons in a group box. That's working okay. I display values in the NFPA diamond as they're entered: left quadrant blue, top quadrant red, left yellow, bottom red. I'm having trouble with the label in which the rating will be displayed on top of a jpg diamond for the white. In this quadrant the text can be up to 4 characters. I can accept the text going into an adjacent block a little, but the corners of the label overlap into another quadrant/color. I reduced the font size which solved the overlap problem but the font is then too small and looks terrible. I tried to make the background of the label transparent to let the color come through correctly but that's not a valid value for label.background. I'm figuring that the transparent background is the best solution. What can I use that will accept a transparent background so the color shows through?
I'm trying to set the transparent property via label properties properties, not via code. Here's the code if it makes any difference:
Public Class NFPA
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Close()
End Sub
[code]....
The following code in C# gives result "228452386"
UInt32 a;
int k = 0;
a = 0x9E3779B9;
a += (UInt32)(url[k + 0] + (url[k + 1] << 8) + (url[k + 2] << 16) + (url[k + 3] << 24));
After above code is ran, "a" contains "228452386" But the following same code in VB.Net results in "Arithmetic operation resulted in an overflow". Basically the last statement is returning value "1868983913" so the runtime error is generated.
Dim a As UInt32
Dim k As Integer = 0
a = &H9E3779B9UI
a += CUInt(AscW(url(k + 0)) + (AscW(url(k + 1)) << 8) + (AscW(url(k + 2)) << 16) + (AscW(url(k + 3)) << 24))
note the variable "url" in above code could be any string and it is same for both codes.
EDIT:When I run the following statements in both C# and VB.Net than they both return same value
C#
(UInt32)(url[k + 0] + (url[k + 1] << 8) + (url[k + 2] << 16) + (url[k + 3] << 24))
VB.Net
CUInt(AscW(url(k + 0)) + (AscW(url(k + 1)) << 8) + (AscW(url(k + 2)) << 16) + (AscW(url(k + 3)) << 24))
Both statements return value "1868983913" for "url" "info:microsoft.com". But when I run complete statement with a += ..then VB.Net gives error while C# returns value "228452386".
VB.NET Code:
Module Module1
Sub Main()
Dim x, y As Single
x = 0 + (512 / 2 - 407) / 256 * 192 * -1
[code].....
returns 0: 0
i got two forms
form1 (frmUserDetails)
form2 (frmSearchForm)
when i click the search button in form1, form2 appears.
i get the information i want from form 2 and store it in a variable.
when i close form2 and form1 is active again i want this code to run automatically:
[Code]...
I must admit it's been a few years since my RegEx class and since then, I have done little with them. So I turn to the brain power of SO. . . I have an Excel spreadsheet (2007) with some data. I want to search one of the columns for a pattern (here's the RegEx part). When I find a match I want to copy a portion of the found match to another column in the same row.
[Code]...
i got two forms
form1 (frmUserDetails)
form2 (frmSearchForm)
when i click the search button in form1, form2 appears.i get the information i want from form 2 and store it in a variable.when i close form2 and form1 is active again i want this code to run automatically:
Me.userIDsearch = frmUserSearch.NuNameTB
Try
'TODO: This line of code loads data into the 'SoftwareLookupDataSet.tbl_software' table. You can move, or remove it, as needed.
Me.Tbl_softwareTableAdapter.Fill(Me.SoftwareLookupDataSet.tbl_software)
[code]....
how would i get the above code to run when the focus is back on form1?
I have a asp.net mvc route that is taking a url and doing a simple get and return the status code from the request.
<AcceptVerbs(HttpVerbs.Post)> _
Public Function ValidateUrlStatusCode(ByVal url As String) As ActionResult
Dim code As Integer = 0
[Code]....
Now if I use firefox (using Firebug) and go to the url http://www.facebook.com/blah.html, I get the expected 404 returned. However if I use my application to call the mvc route via an ajax call, I get 200. If I set the request object's AllowAutoRedirect to false, I get 302. I never get a 404. I am verifying this once again through Firebug.
I have a asp.net mvc route that is taking a url and doing a simple get and return the status code from the request.
<AcceptVerbs(HttpVerbs.Post)> _
Public Function ValidateUrlStatusCode(ByVal url As String) As ActionResult
Dim code As Integer = 0
[code].....
I am using the tutorial laid out here http://www.androidsnippets.com/vbnet-server-side-code-to-send-c2dm-messages to attempt to send a message to my device. I have requested a device ID and placed that string in the RegID String.I receive a (what looks like a) GUID for the googleAuthToken successfully, but when the rest of the code executes,the response I get is Error= MissingRegistration. What exactly am I missing to implement C2DM from a server via VB.NET?
View 1 RepliesIt looks like this: Itis stripping out HTML characters.
Imports System.Text.RegularExpressions
Function GetTextFromHtml(ByVal htmlText As String) As String
[code].....
I think that we can specify or import our properties that we wish to use in the project in the .vbproj file of our project.
And.. if so, how will I use these in my VB source code... ?
I want to keep the table names, connection strings, etc in the properties file.
I have an ASP.NET web application (VB.NET) using an Oracle database. On an insert, I need to get the identity of the inserted row back. I am trying to use RETURNING, but I keep getting a value of 1 returned.
Dim strInsert As String = "INSERT INTO L.TRANSACTIONS (LOCATION_KEY, TRANS_CREATOR, TRANS_EMAIL, TRANS_PHONE) VALUES (:location_key, :trans_creator, :trans_email, :trans_phone) RETURNING TRANS_ID INTO :ukey"
[Code].....
I have a file called setting.xml which contains the following:
<?xml version="1.0" encoding="utf-8"?>
<settings
licenseServiceType="1"
protectedStorageFile="%AppDomainAppPath%App_Datastorage.psf"
[code]....
I am trying to get Profile properties in the code behind. But I am not getting any intellisence like Profile.Homephone or Profile.CellPhone. When I try:
Dim memberprofile As ProfileBase = HttpContext.Current.Profile
Dim homePhone As String = memberprofile.GetPropertyValue("HomePhone").ToString()
[code].....
How would I set the following property from code
chart1, series, series1, Data, XValueType, Datetime
I am using VB 2010 and have the following code written in C that is used to access some PDF properties. translate this to VB?
[Code]....
How can I set properties like the Padding and Location in code?
View 3 RepliesI am not exactly sure what I am looking for here.. So I have this code to disable the close button on a form (Red X):
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const CS_NOCLOSE As Integer = &H200
cp.ClassStyle = cp.ClassStyle Or CS_NOCLOSE
[Code]...
I have been taking a class in Visual Basic and am currently working on my final project which I am having some trouble with. I am using Visual Basic 2010 express The project is to create an application that will store data in a text file, specifically, Last Name, First Name, Customer Number, Address, City, State, ZIP Code, Telephone Number, Account Balance, and Date of Last Payment. I have gotten everything done except the ability to search the file by Last Name or Customer Number. I have no idea how to go about this? I was thinking of ways to use indexof or Readline to be able to search the data, but I'm not familiar enough with the code to come up with a good solution. Below is a picture of how my form looks..As you can see, I'm currently using 2 separate forms to get the data from the user. Here is the code for Form1 which is the "Customer Accounts" form in the picture.
Imports System.IO
Public Class Form1
Public customerFile As StreamWriter ' Object variable
Public customerFile1 As StreamReader ' Object variable
Public strFile As String
[Code]...
There isn't enough room to post the code for my secondary form, but you get the idea. I would like to be able to enter a search term in the textbox on the bottom right of the form, and either search the data as its displayed in the listbox, or search the actual file? I was thinking that the results would be displayed in a messagebox?
My brain may just be fried since it's the end of the semester, but my teacher kicked this back to fix and resubmit...she said that I am "returning the name of your function rather than your variable name".
Here is my code for all 3 forms.
code:
These are forms to calculate the cost of getting a cell phone package.
On a .aspx page, what is the best way to link a server control's property to a property of the page class (its code-behind)? The only way that I have read about is to use databinding:
<asp:TextBox ID="txt" runat="server" Text='<%# Me.SomePropOfMine %>' />
and then call Me.txt.DataBind() or Me.Databind() from the codebehind. Is there any way of establishing this relationship on the .aspx page alone, or simplifying the process if you have many controls to bind (without binding the entire page)?
I'll put some C# code below that should explain what I'm trying to do. I just don't know how to do it in VB. Additionally, for future ref, if you could tell me what this process is called
// Here is a simple class
public class FullName
{
[Code]....
I would like to use a loop to manipulate a set of objects on the form. This is like using a control array but not,... Here is some code to consider:
[Code]....
Process1.StartInfo.WorkingDirectory is not returning the path of the process and Process1.StartInfo.FileName is not returning the file name?
View 3 RepliesI have a funtion that returns a generated PDF file but the problem is it shows it in the current browser window... I need for it to open in a new window. I dont see how I can pass it into a view for displaying where I could simply use target: _blank.
Function showUserPDF(ByVal pdfName As String) As ActionResult
Dim _fileName As String = pdfName
Dim _path As String = Path.Combine(AppDomain.CurrentDomain.BaseDirectory) +
[Code].....
I have a custom control defined in code-behind:
Public Class MyControl
Inherits Button
Private _A As String
[Code]......
What code I have to write to bind to those properies?