Tagged Questions
-2
votes
0answers
161 views
Convert varbinary(max) column data to a file on disk from SQL Server database? [closed]
How can I copy varbinary(max) column data to a respective file on disk or UNC Path from SQL Server database as soon as it get inserted into database table? It should automatically get converted to ...
1
vote
1answer
34 views
Reading binary data into a c# struct
I have a file containing binary data with a format that matches this struct:
struct MyStruct {
UInt32 count;
UInt32[] items;
}
The binary data can be any length as there can be any number ...
0
votes
0answers
70 views
Nhibernate incrementally saving binary data
Following up from Avoiding the LOH when reading a binary
In Nhibernate would it be possible to save a Stream to database in chunks?
With the following code, a FileStream is opened and its contents ...
0
votes
1answer
299 views
Display Button for binary content in datagridview
I have an xml file which acts as a data table. It holds various types of data. The data types could be different in any of the columns. An example would be: row(1)String, int, date; row(2)Binary, ...
0
votes
2answers
1k views
How to display an Image with a fixed size, fetched from the Database in ASP.NET
My Table in the Database contains a column with a type : image.
I have managed to upload the image to the database.
But almost all tutorials out there, shows us how to give the Image Controller a ...
-3
votes
1answer
658 views
Calculating adjacency matrix from randomly generated graphs
I have developed small program, which randomly generates several connections between the graphs (the value of the count could be randomly too, but for the test aim I have defined const value, it could ...
4
votes
4answers
124 views
Basic Binary Reading
I am trying to read a file using BinaryReader. However, I am having trouble in retrieving the value that is expected.
using (BinaryReader b = new BinaryReader(File.Open("file.dat", FileMode.Open)))
...
0
votes
3answers
517 views
Download file from filestream
I have a field in database of type image which stores the file in binary format.
Now I want to give a facility to user from where the user can downlaod that file.
I have the file data in byte array ...
0
votes
2answers
79 views
How to quickly copy a part of binary file?
I need to do some operations in the middle of a binary file (change string value, boolean or int32) and leave everything else as it was. How can I quickly skip items I don't need to work with and get ...
2
votes
3answers
240 views
Determining “Borrow” when subtracting binary numbers [closed]
I am trying to write a chip8 emulator in C#. It will be necessary to simulate in software the operations that take place in hardware on the real chip.
There is an opcode that requires detecting a ...
0
votes
1answer
144 views
Bit Conversion trying to write into a stream
I have a string which represents a binary number: "1010", which represents a 10(ten) in decimal.
I need to write this string into a Stream but keeping the binary format. When normally you want to ...
0
votes
1answer
128 views
Growl for windows, custom subscriber - How to set notification properties in code? e.g. Sound
Trying to set certain properties for an applications notifications in Growl for Windows. (Properties being: duration, sticky, priority and sound)...
So, for example, I'm creating a new application, ...
3
votes
4answers
585 views
How send data (TCP) in binary frame format
I need to stream data to a TCP-server and havnt done it before. The data should be in binary frame format. I googled and found this tutorial which I think describes what I need to do:
...
0
votes
3answers
719 views
extract a stored png image from a binary file the right way
I have binary files which contain each one PNG file at a time (the binary file is not a DLL, not a EXE, nothing usual, just a file which contains different textual information, a PNG file and some ...
1
vote
1answer
164 views
how to optimize data load from binary file
I have a binary file encoded with little endian and containing ~250.000 values of var1 then another same number of values of var2. I should make a method that reads the file and returns a DataSet with ...
0
votes
1answer
829 views
How to encode xml doc as a base64 binary object
I'm trying to call an xml-rpc web service method that takes 1 parameter (an array of values) key and leads.
Key must be named 'key' and must have a value of type string.
Leads is an xml document ...
0
votes
1answer
421 views
Why can I use FileSystemObjects for reading and writing client-side binary files, but not for reading and sending them to the server?
I created a binary file in the following manner (to ensure that all the possible byte values are in the binary file):
using (var fs = File.Create(fileName))
{
for (byte b = 0; b < ...
0
votes
4answers
1k views
Using BinaryWriter to seek and insert data
Background:
I'm fairly new to C# and currently working on a project intended primarily for learning. I am creating a library to work with .PAK files, as used by Quake and Quake II. I can read and ...
3
votes
3answers
289 views
Ascii range regards binary files?
ive been reading about this topic and didnt get the specific info for my question :
(maybe the following is incorrect - but please do correct me)
Every file( text/binary) is saving BYTES.
byte is ...
2
votes
1answer
680 views
How to post a binary image from desktop app to ashx handler and receive it?
I am developing a WinForms application and want to send a binary image data to web application. How does it work?
I coded this:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
...
1
vote
2answers
148 views
improving conversions to binary and back in C#
I'm trying to write a general purpose socket server for a game I'm working on. I know I could very well use already built servers like SmartFox and Photon, but I wan't to go through the pain of ...
1
vote
1answer
245 views
Pass binary data from C to C# through the console
I have two applications, one written in C and the other one in C#, which talk through console string messages. They both wait until the other sends a string message.
Now I want that at a certain ...
2
votes
1answer
849 views
Using BinaryFormatter in a sequential manner in C#
Note: I'm aware about the disadvantages of using BinaryFormatter in large files. But this is a homework for my friend:
(.Net Framework 4)I have created a simple Person class which should be ...
12
votes
3answers
449 views
Fastest way to read many 300 bytes chunks randomly by file offset from a 2TB file?
I have some 2TB read only (no writing once created) files on a RAID 5 (4 x 7.2k @ 3TB) system.
Now I have some threads that wants to read portions of that file.
Every thread has an array of chunks it ...
3
votes
2answers
201 views
Binary File Deserialization using PtrToStructure in C#
I'm trying to reverse engineer a bunch of legacy binary data at my company, so that I can move it into a more durable format. The application we used to create this data is no longer supported.
I ...
1
vote
6answers
12k views
convert from Binarydata to image control in asp.net
I have binarydate of image in my database and I want to display it in image control in asp.net How ? if it is impossible please find another way to save it on database and display it in image control ...
1
vote
3answers
651 views
Send/Receive GZip compressed MSMQ messages in C#
I am trying to send large objects (>30MB) to a MSMQ queue. Due to the large amount of data we are are tring to send the idea was to GZip the objects prior to sending them, then unzipping them on the ...
3
votes
1answer
3k views
Postgres bytea column is returning string (char array) instead of byte array
I have been using C# to write a concrete provider implementation for our product for different databases. W/out getting into details, one of the columns is of byte array type (bytea in postgres - due ...
1
vote
1answer
365 views
Getting Binary Data from StandardOutput
I'm starting a process with code similar to that below:
// some of the flags are not needed
process.StartInfo.CreateNoWindow = true;
process.StartInfo.ErrorDialog = false;
...
2
votes
2answers
1k views
C# - Attach file saved in database to an email
How can I add one or more files that are saved in a MS SQL database to an email? I already know how to attach files saved in a directory or from a fileUpload control.
My datable fields are as such:
...
0
votes
4answers
2k views
Read binary file in C# from specific position
Is it possible to read a large binary file from a particular position?
I don't want to read the file from the beginning because I can calculate the start position and the length of the stream I need.
...
2
votes
0answers
233 views
Which is faster reading binary data or just plain text data?
I have some data that I know its exact structure. It has to be inserted in files second by second.
The structs contain fields of double, but they have different names. The same number of struct have ...
4
votes
2answers
3k views
StreamReader and binary data
I have this text file what contains different fields. Some fields may contain binary data. I need to get all the data in the file but right now when using StreamReader then it wont read the binary ...
2
votes
3answers
98 views
Application-specific data and how to handle it?
I am curious as to how applications generate their own data that is used with the application itself. For example, if you take any kind of PC game's save file or some sort of program that generates ...
1
vote
3answers
774 views
Which encoding to use for reading a string from a file?
I'm parsing a file (which I don't generate) that contains a string. The string is always preceded by 2 bytes which tell me the length of the string that follows.
For example:
05 00 53 70 6F 72 74
...
2
votes
4answers
173 views
Converting binary reading function from C# to C
I am honestly really confused on reading binary files in C.
My data is in a format like:
int header
Cell[][] cells, 8x8 matrix
Each cell is just a short id and a sbyte z.
However, something is ...
1
vote
4answers
3k views
How to read a binary file using c#?
I have got a binary file. I have no clue how to read this binary file using C#.
The definition of the records in the binary file as described in C++ is:
#define SIZEOF_FILE(10*1024)
//Size of ...
4
votes
3answers
8k views
How do you read binary data in C# .NET and then convert it to a string?
As opposed to using StreamReader/Filestream I want to read binary data from files and show that data (formatted) in a textbox.
1
vote
2answers
539 views
Change Assembly Name during Binary Serialization
Let me briefly explain my architecture before I ask my question. I have a client application that calls out to a web service and passes it a couple of items of data. The web service uses this data to ...
2
votes
5answers
3k views
Insert image into xml file using c#
I've looked everywhere for the answer to this question but cant find anything so hoping you guys can help me on here.
Basically I want to insert an image into an element in xml document that i have ...
2
votes
5answers
428 views
Is the source code visible through the binary file ? (C#)
Hey Guys.
I have written a program in c# with Vistual studio 2008.
I've compiled and build it and got a .EXE file.
My question is this - if I give someone else this .EXE file
can he in any way see the ...
2
votes
3answers
583 views
How to open or run unknown file coverted into byte[]
I use to store document/file in byte[] in database, and I want user can view/run that file from my application.
Any Idea
Thanx
3
votes
1answer
899 views
Is there any C# framework or code to parse *blg Perfomance Counter log files?
The task is not to gather Performance counters data in my .NET app, but open already prepared binary log files (*.blg)?
I know that MS SQL Profiler (.NET app) can parse binary logs.
1
vote
1answer
141 views
4
votes
2answers
473 views
Can I use C# Serialization to read a binary file in custom format?
I have a custom binary file which I want to read into my C# program.
There are several different formats, some MSB first, some LSB first and some with the variables in different orders.
Currently, I ...
2
votes
1answer
565 views
How do I store arbitrary binary data in a binary serialized class?
Using C#/.NET for my application, I've got a series of classes in my main data model that represent "binary" (as opposed to text) content. I've got a inheritance setup like this:
Basically, the ...
0
votes
3answers
857 views
Is it possible to match a regex against binary data in .net?
I know that I can use regex to match substrings in a string, but is it possible to match some patterns in binary data using regex? If so then in what format should the binary data be - binary ...
3
votes
1answer
88 views
C# - can binary data be compiled into a module?
I want to include a large look-up table (100,000 of 3-byte values) inside a C# module.
Is there a compiler directive that will load binary data from an external file into a static string ?
0
votes
3answers
4k views
Read .dat file in c#
i want to read a .dat file that have following conditions:-
First name offset 21
First name format ASCIIz 15 chars + \0
Middle initials offset ...
0
votes
1answer
1k views
Creating a binary file from an IntelHex in C#
I'm trying to create a binary file from a intelHex file. Iside the intelHex file I have data and address to which I should write the data inside the binary file.
IntelHex file looks like that
...