当前位置: 动力学知识库 > 问答 > 编程问答 >

vb.net - Create json text from Visual Basic GUI input

问题描述:

I'm trying to create an app in Visual Basic that will allow a user to input an address, state, zip, some radio buttons and other data that will then add information into a json file.

The JSON text is set up like this:

{"ChapterId":1,

"ChapterName":"Batesville",

"Region":1,

"Field1":"TestField1aData",

"Field2":"TestField2aData",

"Field3":"TestField3aData",

"Address":"72501",

"Latitude":35.775765,

"Longitude":-91.641083,

"ChapterType":"Active"},

The current Visual basic app is divided into two forms. The first form shows all "chapter" names which can then be clicked on and edited or create a new "chapter" which will then open a chapter editor. One thing I'm having trouble with is opening a current JSON file and formatting it to show up in the txtboxes I have set up for editing. Also, I want the chapter names to show up in a collection. When the user highlights a collection in a combobox and clicks a button it will open a window (having trouble with that too).

So the Visual Basic program opens up the JSON file (unable to get that to open)

Imports "Chapter Name" into a collection.

When a user clicks on a item in the combobox and then presses add new chapter or edit chapter it is then able to edit said JSON file.

IF ADDING NEW CHAPTER

The text will be able to create a new "chaptername" and add a new region address state as seen in the JSON script example. When the user clicks the update button, the new JSON text is added to the original JSON file.

IF EDITING A NEW CHAPTER

The text boxes show the original data from the selected chapter and will then be able to update that original "chapter" section.

OPTION TO REMOVE CHAPTERS

How to remove one of those sections of code within the visual basic .exe file

I'm doing this for a charitable organization (I know it seems like I'm asking for a lot of info, but I have to get this done within 30 hours and I'm pretty new to visual basic)

Thanks for your help.

网友答案:

Use Json.net or Json serialization. Have a look at MSDN article - An Introduction to JavaScript Object Notation (JSON) in JavaScript and .NET

分享给朋友:
您可能感兴趣的文章:
随机阅读: