Click here to Skip to main content
15,921,941 members
Home / Discussions / C#
   

C#

 
AnswerRe: grid control, tile view Pin
OriginalGriff28-Sep-15 20:11
mveOriginalGriff28-Sep-15 20:11 
QuestionWhy can I save the error information into the table of SQL server ? Pin
Member 245846728-Sep-15 17:40
Member 245846728-Sep-15 17:40 
AnswerRe: Why can I save the error information into the table of SQL server ? Pin
Wendelius28-Sep-15 17:57
mentorWendelius28-Sep-15 17:57 
GeneralRe: Why can I save the error information into the table of SQL server ? Pin
Member 245846729-Sep-15 17:36
Member 245846729-Sep-15 17:36 
GeneralRe: Why can I save the error information into the table of SQL server ? Pin
Wendelius29-Sep-15 18:15
mentorWendelius29-Sep-15 18:15 
GeneralRe: Why can I save the error information into the table of SQL server ? Pin
Member 24584672-Oct-15 2:56
Member 24584672-Oct-15 2:56 
QuestionSitemapnode(breadcrumb) value changes with multiple users Pin
nitin_ion28-Sep-15 4:09
nitin_ion28-Sep-15 4:09 
AnswerRe: Sitemapnode(breadcrumb) value changes with multiple users Pin
Pete O'Hanlon28-Sep-15 4:58
mvePete O'Hanlon28-Sep-15 4:58 
AnswerRe: Sitemapnode(breadcrumb) value changes with multiple users Pin
Richard Deeming28-Sep-15 6:30
mveRichard Deeming28-Sep-15 6:30 
QuestionPort some C++ code which contains WriteFile to C# Pin
Member 1206160028-Sep-15 1:48
Member 1206160028-Sep-15 1:48 
AnswerRe: WriteFile equivalent in C# Pin
Pete O'Hanlon28-Sep-15 3:00
mvePete O'Hanlon28-Sep-15 3:00 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 3:18
Member 1206160028-Sep-15 3:18 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 3:21
Member 1206160028-Sep-15 3:21 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 3:40
mveDave Kreskowiak28-Sep-15 3:40 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 3:55
Member 1206160028-Sep-15 3:55 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 4:09
mveDave Kreskowiak28-Sep-15 4:09 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 4:15
Member 1206160028-Sep-15 4:15 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 4:25
mveDave Kreskowiak28-Sep-15 4:25 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 4:32
Member 1206160028-Sep-15 4:32 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 7:07
mveDave Kreskowiak28-Sep-15 7:07 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 7:31
Member 1206160028-Sep-15 7:31 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 7:46
Member 1206160028-Sep-15 7:46 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 8:35
mveDave Kreskowiak28-Sep-15 8:35 
GeneralRe: WriteFile equivalent in C# Pin
Member 1206160028-Sep-15 9:06
Member 1206160028-Sep-15 9:06 
GeneralRe: WriteFile equivalent in C# Pin
Dave Kreskowiak28-Sep-15 12:19
mveDave Kreskowiak28-Sep-15 12:19 
After closer examination of your original post, it's pulling a little trick based on failure. The DCB structure is a Device Control Block[^] used in serial communication. The Win API treats files and serial comm the same, as a stream of data.

What it's doing is taking a path, to either a COM port or a file, and attempts to open that path and setup a DCB. If the DCB application to the CreateFile handle fails, it assumes the path is a file.

As has already been said, you can either use the same C code in C#, rewritten of course, and use the same trick, or you can simplify the code and just ask the user which they are going to use and go with normal SerialPort or File based code.
A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.