Read Write File using File Stream in Dot Net

file-computer

Read file in byte array in vb.net : Public Function Reader(ByVal FilePath_ As String) As Byte() Dim BytArr(FileSystem.FileLen(FilePath_) – 1) As Byte Using fs As New FileStream(FilePath_, FileMode.Open, FileAccess.Read, FileShare.ReadWrite) fs.Read(BytArr, 0, BytArr.Length) fs.Close() End Using Return BytArr End Function Read file in String : Public Function ReaderString(ByVal FilePath_ As String) As String Dim data_str As String Using fs As New FileStream(FilePath_, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite) Using Sr As New StreamReader(fs) data_str = Sr.ReadToEnd Sr.Close() fs.Close() End Using Return data_str End Using End Function Read File with Encoding (using default encoding…

Read More

Run Command in Windows

‘Run’ dialogue in Microsoft Operating system provides the execution of various commands without opening the Command Prompt, although Command Prompt have its own features and usability. Microsoft windows operating system provides much flexibility to users in terms of Design, Development and Distribution of Application either Windows Based Application or Web Based Application. We can execute any command using ‘Run’ : Press “Windows” Button +  “R” Button  on your keyboard simultaneously.

Read More

Open Internet Explorer from Command

IE-Header

Microsoft operating system have pre-installed web browser ‘internet explorer’. But with the emerging of Windows 8, 8.1, 10  Microsoft is focusing More in its Browser Microsoft Edge rather than Internet Explorer. Microsoft Edge have many new features and functionalities that makes it better than internet explorer and make it stand with other competitive web browsers. But there are some applications (specially java applet based and Digital Signature Based) that requires internet explorer to work properly. Following are the steps to open internet explorer : Open Windows Run (Windows Key +…

Read More

Run Command in Windows as Administrator

command-as-administrator

Microsoft windows operating system provides much flexibility to users in terms of Design, Development and Distribution of Application either Windows Based Application or Web Based Application. Sometime it is required to run specific commands As Administrator as Current user have some limited rights or user want to install or change a windows setting that is not possible by the current user rights. Running a Command As Administrator provides the ‘Admin’ privilege to the executing Assembly (Exe or Any File).   To Run a command As Administrator : Press Windows Button…

Read More