For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
var stringToHash = "10123456789" + "2014:11:25-15:42:00" + "20.00" + "826" + "sharedsecret";
var bytes = Encoding.ASCII.GetBytes(stringToHash);
var hexString = BitConverter.ToString(bytes).Replace("-", string.Empty);
SHA1 sha = new SHA1CryptoServiceProvider();
var password = sha.ComputeHash(bytes);
var result = BitConverter.ToString(password).ToLower().Replace("-", string.Empty);
var hexStringBytes = Encoding.ASCII.GetBytes(hexString);
var hexStringPassword = sha.ComputeHash(hexStringBytes);
var hexStringResult = BitConverter.ToString(hexStringPassword).ToLower().Replace("-", string.Empty);
The first two outputs are the same. The original strings are identical, as are the ASCII hex arrays after conversion, but sha1() in PHP is giving me a different outcome to .net's SHA1CryptoServiceProvider. If I convert that output to a string and hash it again, the result is also different.
In .net, an object has to be in the form of a byte array before you can create an SHA hash from it, and I don't understand what I need to convert to the byte array to produce the same output as the PHP code.
This is problematic as the third party service I am posting to uses the PHP version to verify an object on their end, and my program is written in .net. I could write a middle-man in PHP and relay through that, but I really don't want have to do that.
Any insight into why the two are giving different results? Thanks
Message=Riferimento a un oggetto non impostato su un'istanza di oggetto.
in Prova1.ViewModel.MainViewModel.SalvaBusta(Busta Bus) in k:\c#\MVVMLight\Prova1\Prova1\ViewModel\MainViewModel.cs:riga 102
Just to clarify: please put your environment international settings to English to allow all the users to answer (at least to understand the error message).
It looks you have a pointer not associated with any object, check or add some initialization. The message tells you precisely which line of code is wrong, but we have no explicit line numeration visible.
Busta.BustaID = _serviceProxy.CreateBusta(Bus);
is totally wrong: you are using the name of the class as it if is an OBJECT. You would probably use Bus instead of Busta.
To help you not doing the same mistakes be careful to differentiate consistently between the name of a type (or class or enum) and it's object identifiers, or it is easy to be confused.
I apologize to everyone for my code confusing because you are a student of 40 years autodidact who does it for a hobby, I'll do a bit of order.The meantime I wanted to show how I did the DB because the property and that nothing is shop and is the property navigation, here they are;
CREATE TABLE [dbo].[Busta] (
[BustaID] INT NOT NULL,
[NegozioID] INT NOT NULL,
[NomeCliente] VARCHAR (25) NULL,
PRIMARY KEY CLUSTERED ([BustaID] ASC),
CONSTRAINT [FK_Busta_Negozio] FOREIGN KEY ([NegozioID]) REFERENCES [dbo].[Negozio] ([NegozioID])
CREATE TABLE [dbo].[Negozio] (
[NegozioID] INT NOT NULL,
[RagioneSociale] VARCHAR (20) NOT NULL,
PRIMARY KEY CLUSTERED ([NegozioID] ASC)
I have four selection list boxes.....authorList publisherList yearpublishedList and genreList..
I have managed to write code that enables me to click on 1 or more of the boxes and get a result.
For example if I click on Ken Davies in the Authors list then all his books will appear.I can then click on the second box the publishers list and this will narrow his books down to that publisher and so on.
My problem is this,once I have clicked on any of the lists I have to make a selection in that list.For example if I click on author Ken Davies in the authors list,I can't find a way of "unclicking" that list.I have to stay with it and select another author or otherwise close and open the program again.
The problem being that If I was checking an author,then I decided I just wanted to check genre ,I cant because an author is already selected.
My question is this.Is there a way I can just reset the program,or perhaps is there a way tha I could "uncheck" an item in a list.
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
EndSubPrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con AsNew OleDb.OleDbConnection
Dim dbProvider AsStringDim dbSource AsStringDim ds AsNew DataSet
Dim tables As DataTableCollection = ds.Tables
Dim source1 AsNew BindingSource()
Dim da AsNew OleDb.OleDbDataAdapter
Dim isFirstColumn AsBoolean = TrueDim author AsString = ""Dim publisher AsString = ""Dim yearpublished AsString = ""Dim genre AsString = ""Dim aa AsString = authorList.Text
Dim bb AsString = publisherList.Text
Dim cc AsString = yearpublishedList.Text
Dim dd AsString = genreList.Text
Dim astring AsString = "SELECT * FROM books "If authorList.SelectedIndex > -1 ThenIf isFirstColumn Then
author = "WHERE author = '" & aa & "' "Else
author = "AND author = '" & aa & "' "EndIf
isFirstColumn = FalseEndIfIf publisherList.SelectedIndex > -1 ThenIf isFirstColumn Then
publisher = "WHERE publisher = '" & bb & "' "'Else
publisher = "AND publisher = '" & bb & "' "EndIf
isFirstColumn = FalseEndIfIf yearpublishedList.SelectedIndex > -1 ThenIf isFirstColumn Then
yearpublished = "WHERE yearpublished = '" & cc & "' "'Else
yearpublished = "AND yearpublished = '" & cc & "' "EndIf
isFirstColumn = FalseEndIfIf yearpublishedList.SelectedIndex > -1 ThenIf isFirstColumn Then
genre = "WHERE genre = '" & dd & "' "Else
genre = "AND genre = '" & dd & "' "EndIf
isFirstColumn = FalseEndIf
dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;"
dbSource = "Data Source = C:\Documents and Settings\james\Desktop\authors2.accdb"
con.ConnectionString = dbProvider & dbSource
Dim sql AsString = astring & author & publisher & yearpublished & genre
da = New OleDb.OleDbDataAdapter(sql, con)
Dim view1 AsNew DataView(tables(0))
source1.DataSource = view1
DataGridView1.DataSource = view1
<pre lang="vb"><pre lang="vb"><pre lang="vb">
A very important issue is that your code must be "clean" to be testable (see also Robert Martin "Clean Code"). Classes with several thousand lines of code, functions with hundreds of lines of code are not testable. You'll have to write many small classes with small functions. That could be the hardest issue when starting.
i have bought T5567 rfid read or write.link of myw reader is http://www.ebay.com/itm/321488854348?_trksid=p2060778.m570.l4467&_trkparms=gh1g%3DI321488854348.N19.S2.M-34323.R1.TR1
ho can help me to make connection with reader because the reader not going to make a realized a connection.
If I say you to cut a paper of dimension 5m by 5m then surely you would do that. But then I ask you to cut 1000 paper of the same dimension. Then you won't do the measuring for 1000 times, obviously you would make a frame of 5m by 5m and then with the help of it you would be able to cut 1000 papers in less time. So, what you did is you made a framewok which would do that type of task. So, instead of performing same type of task again and again for same type of applications, what you do is you create a framework having all those facilities together in one nice packet and hence providing the abstraction for your application and more importantly many applications.
Can anyone please provide a same way example about library.
“That which does not kill us makes us stronger.” ― Friedrich Nietzsche
Dim FileName AsString = System.IO.Path.GetFileName(FileUploadBenGrid.PostedFile.FileName)
Dim FilePath AsString = System.IO.Path.GetFullPath((FileUploadBenGrid.PostedFile.FileName))
'Read file into a stream
Dim fs As FileStream = New FileStream(FilePath, FileMode.Open, FileAccess.Read)
Dim br As BinaryReader = New BinaryReader(fs)
Dim bytes AsByte() = br.ReadBytes(Convert.ToInt32(fs.Length))
Select a file to upload
I'm hoping someone here can help me. I have been asked by a business unit in my company to find the cause of why a dotNet program cannot run on a certain Dell model laptop. It runs fine on a newly image laptop of all different Dell model of laptops and desktop, but for some reason on a Dell M8600 it fails to open. The M8600 has the same .Net 4.5.2 install. Could there be a missing driver that is needed to load a dotNet executable?
I'm sorry if any of my statements don't make sense. I'm not a programmer or scripter. So I am way out of my comfort zone here. I am completely loss as what could be the reason why the program is failing on a particular model of laptop.
I was told that the program was written in dotNet 4.0. I'll get the error message and application event logs tomorrow when I go back into the office.
This is from the detail error message when the application is opened:
Problem Event Name: CLR20r3
Problem Signature 01: SPAAR.exe
Problem Signature 02: 188.8.131.52
Problem Signature 03: 54216f68
Problem Signature 04: SPAAR
Problem Signature 05: 184.108.40.206
Problem Signature 06: 54216f68
Problem Signature 07: df
Problem Signature 08: 71
Problem Signature 09: System.NullReferenceException
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
at SPAAR.Form1.Form1_SizeChanged(System.Object, System.EventArgs)
at System.Windows.Forms.Control.UpdateBounds(Int32, Int32, Int32, Int32, Int32, Int32)
at System.Windows.Forms.Control.UpdateBounds(Int32, Int32, Int32, Int32)
at System.Windows.Forms.Control.SetBoundsCore(Int32, Int32, Int32, Int32, System.Windows.Forms.BoundsSpecified)
at System.Windows.Forms.Form.SetBoundsCore(Int32, Int32, Int32, Int32, System.Windows.Forms.BoundsSpecified)
at System.Windows.Forms.Control.ScaleControl(System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified)
at System.Windows.Forms.ScrollableControl.ScaleControl(System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified)
at System.Windows.Forms.Form.ScaleControl(System.Drawing.SizeF, System.Windows.Forms.BoundsSpecified)
at System.Windows.Forms.Control.ScaleControl(System.Drawing.SizeF, System.Drawing.SizeF, System.Windows.Forms.Control)
at System.Windows.Forms.ContainerControl.Scale(System.Drawing.SizeF, System.Drawing.SizeF, System.Windows.Forms.Control)
at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean, Boolean)
The exception, "System.NullReferenceException", says that you're trying to get/set a property of call a method on an object that your code is ASSUMING exists, but doesn't. You're not checking for the existence of the object you're trying to do something with before you try and use it.
Somewhere in the method "Form1_SizeChanged", you goofed.