9 Replies - 3219 Views - Last Post: 14 March 2012 - 01:40 AM Rate Topic: -----

#1 efham computer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 12

how can i editing Js file by vb.net 2010

Posted 11 March 2012 - 08:58 PM

Hi :I am still a beginner in the program vb.net

I want to know how to get the name of the profile's default of firfox by vb.net

and

how can i editing Js file on vb.net < like i want to insert txt on the je file Under the line number 47

I am very sorry I hope you help me and excuse me because I do not speak English
Is This A Good Question/Topic? 0
  • +

Replies To: how can i editing Js file by vb.net 2010

#2 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 195
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 11 March 2012 - 09:05 PM

hello eflam computer!
i am not sure i really understood what you are asking for... do you have a js file and you want to write code in it at line 47 using a vb net application?
Was This Post Helpful? 0
  • +
  • -

#3 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 583
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: how can i editing Js file by vb.net 2010

Posted 11 March 2012 - 09:51 PM

Might I suggest:
Loop through the file with a StreamReader, add to a String array.
Then you could edit the data at line 47 by this code:
<array>.Item(46) = "value"
I referred to item 47 as 46 because item 1 is actually item 0.
Then use a For Loop and a StreamWriter to write the file back.
If you don't understand any of these search the name of it followed by MSDN VB.Net
:)
Was This Post Helpful? 0
  • +
  • -

#4 efham computer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 12 March 2012 - 04:58 PM

View Postrusoaica, on 11 March 2012 - 09:05 PM, said:

hello eflam computer!
i am not sure i really understood what you are asking for... do you have a js file and you want to write code in it at line 47 using a vb net application?

Yes, that's what I want

View PostDimitriV, on 11 March 2012 - 09:51 PM, said:

Might I suggest:
Loop through the file with a StreamReader, add to a String array.
Then you could edit the data at line 47 by this code:
<array>.Item(46) = "value"
I referred to item 47 as 46 because item 1 is actually item 0.
Then use a For Loop and a StreamWriter to write the file back.
If you don't understand any of these search the name of it followed by MSDN VB.Net
:)

Thank you but I want my work, for example, for I am still a beginner in programming I do not understand what you are saying
Was This Post Helpful? 0
  • +
  • -

#5 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 195
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 12 March 2012 - 05:07 PM

the policy of dream in code is that we do not give code for you to copy/paste. The main goal here is to TEACH you how to do a thing, and to make you understand how it works and WHY it works that way. So, if you are a beginner, instead of giving you the code for your request, i would suggest you first to read a tutorial about working with text files, so you can understand the logics beyound using a code for this task. A good start would be here, they have a nice explained tutorial about opening/writing etc text files in visual basic net. After you read that, try to develop a code based on what you have learned. If THEN you will encounter problems, we are always here to assist you. Hope this helps you!
Was This Post Helpful? 2
  • +
  • -

#6 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 195
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 12 March 2012 - 05:15 PM

also, you can find help about this topic even here, on dream.in.code: reference
Was This Post Helpful? 0
  • +
  • -

#7 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: how can i editing Js file by vb.net 2010

Posted 13 March 2012 - 09:41 AM

Before you embark on this possible journey of misplaced knowledge, various misunderstandings, and great frustration. Understand the fundamentals of OOP. Object Oriented Programming. The very basis for objects such as the streamreader, the class, properties, structures, functions, sub routines, etc. As you say you are new, I say you need to know that all before you continue with your project. This will ultimately allow you to survive without becoming a copy and paste programmer which so many of us oh so despise.

Object Oriented Programming - MSDN "The Good Book"
Was This Post Helpful? 2
  • +
  • -

#8 efham computer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 13 March 2012 - 04:23 PM

View Postrusoaica, on 12 March 2012 - 05:07 PM, said:

the policy of dream in code is that we do not give code for you to copy/paste. The main goal here is to TEACH you how to do a thing, and to make you understand how it works and WHY it works that way. So, if you are a beginner, instead of giving you the code for your request, i would suggest you first to read a tutorial about working with text files, so you can understand the logics beyound using a code for this task. A good start would be here, they have a nice explained tutorial about opening/writing etc text files in visual basic net. After you read that, try to develop a code based on what you have learned. If THEN you will encounter problems, we are always here to assist you. Hope this helps you!

Thank you for the directed sound sources were used to me will be developed by, and I repeat again thank you
Was This Post Helpful? 0
  • +
  • -

#9 efham computer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 13 March 2012 - 11:16 PM

View Posttrevster344, on 13 March 2012 - 09:41 AM, said:

Before you embark on this possible journey of misplaced knowledge, various misunderstandings, and great frustration. Understand the fundamentals of OOP. Object Oriented Programming. The very basis for objects such as the streamreader, the class, properties, structures, functions, sub routines, etc. As you say you are new, I say you need to know that all before you continue with your project. This will ultimately allow you to survive without becoming a copy and paste programmer which so many of us oh so despise.

Object Oriented Programming - MSDN "The Good Book"

Thank you
Was This Post Helpful? 0
  • +
  • -

#10 rusoaica  Icon User is offline

  • D.I.C Head

Reputation: 27
  • View blog
  • Posts: 195
  • Joined: 10-March 12

Re: how can i editing Js file by vb.net 2010

Posted 14 March 2012 - 01:40 AM

@efham computer - you are welcome, sir! if i can help you further, let me know.

Live long and prosper! \\//_
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1