?
Solved

VB --> C#

Posted on 2003-02-23
1
Medium Priority
?
181 Views
Last Modified: 2010-04-15
Anyone who knows how to convert this code to C# ??
Any help would be great.

Dim AviFile As Integer
Dim TempVHeight As Integer
Dim Aviheaderstart As Integer

AviFile = FreeFile()

CDL.Filter = "Avi files (*.avi) |*.avi|" & "All files (*.*) |*.*"
CDL.FilterIndex = 0

CDL.ShowDialog()

FileOpen(AviFile, CDL.FileName, OpenMode.Binary, OpenAccess.Read, OpenShare.LockWrite)

Aviheaderstart = 33

Seek(AviFile, Aviheaderstart + 36)
FileGet(AviFile, TempVHeight)
0
Comment
Question by:lazaruz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
AvonWyss earned 400 total points
ID: 8047061
The CDL object is an object you have to insert into your form and set up there. Therefore, I will only translate the stuff around it and just take a filename.

At the top of the file, make sure to use the following namespaces:
    using System;
    using System.IO;

The rest of your code then is:
               int tempVHeight;
               int aviHeaderStart=33;
               using (BinaryReader aviFile=new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read))) {
                    aviFile.BaseStream.Seek(aviHeaderStart+36, SeekOrigin.Begin);
                    tempVHeight=aviFile.ReadInt32();
               }
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question