|
|
|
How to make windows form control DPI aware??
|
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Hi
I am doing one project using serialport. I have three forms in one form i receive command 'g' from serial port and display it to text box based on specify time interval. And in another form i want to receive command 'c' from serial port and display it to textbox and also wand to send data from textbox to serialport to update that value through one button click. And in last form i want to receive command 'v' from serialport and display it to textbox and send the data from textbox to serialport through button click. I have no idea to start this code... Please help me.... i am new in using serial port communication....
Thanks in advace
|
|
|
|
|
|
I am unable to get path of file that is in portable device.... please suggest me
|
|
|
|
|
Ask the user.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Unless you want to search the entire file system of the device, and in the event of multiple files with the same names GUESS at which one is the correct path, you're going to have to ask the user.
|
|
|
|
|
Probably, you need to explain in much better detail what you are trying to do, and exactly what problem you have met.
Remember we can't see your screen, access your HDD, or read your mind, so we only get exactly what you tell us to work with.
Try again: explain what you have tried, and exactly what problem you are meeting - or we really can't help you with this one!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I have a problem about display control in datagridview using C#. my datagridview have 3 column(A(combobox), B(textbox), C(textbox, width= 50)) and is loaded data from database.
when the form is display, all cell of column C will be displayed as textbox(have border and the width = 30).
I researched but don't found solution. If you know about this, please help me.
Thank in advance.
|
|
|
|
|
WinForms? WPF? ASP.NET? Gtk#?
In case of WinForm, try adjusting the columns' width using the designer.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am having a really strange problem with a component designed to watch for the printer events:
First of all, the component has been working like a charm for years in all of the computers in which I have tested and with several operating systems (Windows XP, Vista, 7 and 8.1), in 32 and 64 bits, and running as normal user and local admin as well. However, in the computers of my last customer (Windows 7 64 bits) it only works when running as local admin which is, of course, unacceptable.
Before bothering the admins of my customer I would like to know if someone of you has any ideas about the issue, because I have to confess I am completely puzzled.
Basically, the compoment starts a thread in which it invokes FindFirstPrinterChangeNotification, which returns a valid handle. Then it invokes WaitForSingleObject for that handle and here is where things get strange: in every other computer, as I said before, it receives and processes the signals perfectly, but in my customer's ones, unless run under local admin, it just stays waiting and receiving no signals no matter what the printer is doing. I mean it does nothing, not even errors. It just waits but the signal does never arrive.
I have been reading through the MSDN documentation but I cannot find any plausible explanation: the printer is a local printer which prints to a file and, yes, WaitForSingleObject requires SYNCHRONIZE access right, which I think shouldn't be a big deal.
I have not pasted code here because, as I said, it works like a charm in every other computer, so it must be a security configuration issue. Any ideas?
Thank you very much.
|
|
|
|
|
FindFirstPrinterChangeNotification queries the printer-driver. Update it, or try another printer.
_Erik_ wrote: it works like a charm in every other computer That proves hardly anything.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I forgot to say this in the original post, sorry for that, but the printer driver was also written by myself, that is why I am so puzzled. Anyways, testing with other printers makes no difference: it works fine everywhere I test it but in the customer's computers it does the same... nothing, not even errors...
Thanks for the tip anyway, Eddy.
|
|
|
|
|
Their IT folks probably twiddled with some group policy settings or something. I don't know how to even begin backtracking from the behavior to which setting it might be.. maybe have a chat with the IT department and see if you can track it down from what settings they change?
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
Yes, I wanted to avoid bothering them, but I guess I don't have any other option. Thank you very much.
|
|
|
|
|
We have an application which is originally written in MFC. The entire business logic is in C++. Couple of years back we had a requirement of moving of the module to web, so we used Silverlight for that. We have added an interop over the existing MFC and then a wrote a WCF Web Service above the interop. Now we are planning to have the same module on mobile platforms as well. For this, instead of writing everything from scratch, I was thinking of utilizing the existing web service. I tried to consume the existing web service in a Windows Phone application but since the existing projects referred in the web service are regular DLLs it is not allowing me to use them. What is the best approach to tackle this? I also read about REST/ASP.NET Web Api, but I am guessing that this requires rewriting a new set of web services just for mobile platforms. I can do that if its the only option, but before going ahead I want to see if there is any solution to utilize the existing WCF Web Service. Any ideas on how to proceed.
|
|
|
|
|
Does this have something to do with C#? There are forums for WCF, Web development and Design, which are better suited to your question.
|
|
|
|
|
The web services have nothing to do with the phone side of the application. Ultimately, with a well written web service, the consumer should not care what it was written in or what runs at the back end. Think about it, you wouldn't worry about rewriting because Windows Phone didn't support Java would you?; What your phone application will need to do is import the service reference for the web service - you will code against this part and your phone application will run happily without caring one bit about what technology is running at the server side.
|
|
|
|
|
Thank you. Even I thought the same, but I was facing errors while importing the service. I'll try again and see if I can make it work. Thanks again!
|
|
|
|
|
Quote: How should i encrypt the data by using SHA1 Algorithm? Please elaborate it?
|
|
|
|
|
You don't.
SHA-1 is not an encryption algorithm. It is a hashing algorithm and the two are very, very different: encrypted data can be decrypted to get the original input back, hashed data cannot.
If you use SHA-1 to "encrypt" for files, you will not be able to get the original files back. Ever.
If you are trying to use SHA-1 to secure passwords, then that's fine: hashing is perfect for that. But do not describe it as "encrypting".
See here: Password Storage: How to do it.[^]
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Hypothetically, how do you complete the code for a static method FileToArray, which reads text files of a special form, where the first line contains the digits of a positive number that we will call n, and there are at least n more lines in the file.
Assume that the string parameter filename refers to an existing text file. FileToArray 1) opens the file, 2) reads n as a string, 3) converts it to an int, and 4) creates a new array of length n. The method then 5) fills the array with n further lines from the file (using a loop, probably a for loop). Finally, the method must 6) close the file and 7) return the array.
For example, if the text file named "fruits.txt" contains these lines:
3
kiwi
mango
pineapple
ignore this
then FileToArray("fruits.txt") returns a new array containing elements {"kiwi", "mango", "pineapple"}, and the file ends up closed. Assume that the file passed to the function has at least one line in it, the number of remaining lines (if the file only has one line in it, that line must contain the number 0).
public static Main()
{
}
public static string[] FileToArray(string filename)
{
}
|
|
|
|
|