|
Xarzu wrote: Where is the settings which tell Visual Studio which html to use when running or debugging.
In the project properties.
Xarzu wrote: How do I include my own html in a silverlight project?
Right click the project in solution explorer of use the project menu and choose add new item. Add an HTML page.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I need to communicate with fiscal printer via third party software (Don't ask me way).
I'm sending command file in one folder and receive answer file in another folder.
My print method need to return number of fiscal invoice which is generated by printer and can be found in answer file.
So my method look like this
public int PrintInvoice()
{
while(!_answerFileReceived){}
}
Also I have FileSystemWatcher which monitor answer directory (file creation) with code
fswWatcher_FileCreated(object sender, FileSystemEventArgs e)
{
_answerFileReceived = true;
}
My question is "Is this safe" and can I have exceptions, or do you have any suggestion of another approach to above problem.
Thank you.
|
|
|
|
|
Why not using event instead of infinite loop ?
ie:
fswWatcher_FileCreated(object sender, FileSystemEventArgs e)
{
MyInvoiceClass = newe MyInvoiceClass();
int invoiceID = MyInvoiceClass. PrintInvoice();
}
|
|
|
|
|
First I have to send file so PrintInvoice can not be in FileCreated event.
|
|
|
|
|
Not the first part (before the wait-loop), but the second part of it can.
|
|
|
|
|
I agree with you, but my Print method is inside class and must return Invoice number.
Class name is FiscalPrinter and it has method PrintInvoice. So I call
FiscalPrinter printer = new FiscalPrinter()
int InvoiceNumber = printer.PrintInvoice();
Thats why I'm using infinite loop (it will be extended to wait some amount time so it won't be infinite), and I'm not sure is this approach safe.
Thank you for your answers.
|
|
|
|
|
Well there is a problem with that, while you are looping/waiting the event loop can not process the event raised by the file system watcher. Or is it on a different thread? In that case, you should definitely use a real synchronization primitive instead of busy-waiting.
|
|
|
|
|
Asynchronous events tend to get handled on TrheadPool threads, see here[^]. I didn't test specifically for FileSystemWatcher , however I expect them to behave similarly. So yes busy loops are bad and inter-thread synchronization is recommended.
|
|
|
|
|
Well I like to be sure so I looked it up; the example on msdn:filesystemwatcher[^] shows that FSW events happen on a different threat
|
|
|
|
|
Well, it doesn't show it, what it does is proof or disproof depending on whatever the behavior is when you actually run that code. Will it hang waiting for exit? or will it ever report something?
They don't mention the ThreadPool. they even manage to "explain" without using the word "thread" (except for the silly sentence "Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe." which they have on most every page).
|
|
|
|
|
I assumed it would work, perhaps I'm overestimating MS
|
|
|
|
|
Is it possible to bind data in treeview. If not any other control with the functionality...
|
|
|
|
|
|
|
Hello everyone,
I have a Setup project with several UI forms for my application. At the moment I'm trying to create an unattended version of this installation. I pass all the parameters through a command line.
The UI forms are: TextBox(A) and Installation Address.
The thing is that I have a problem with changing the Virtual directory of the Setup project. It's pre-set in in properties window of Web Application Folder of Setup Project's File System. And no matter what I pass as the parameter for Virtual Directory, it gets overwritten by this default value(one that pre-set in properties window). Apparently this happens after the Custom Actions stage.
Is it correct that I not able to change the virtual directory through the command line? Or is there a way to do it?
And is there any way to set the default value for virtual directory programmatically(by code) after processing the CustomActionData parameters in Install Class?
Any help will be appreciated. Thank you in advance.
Igor
|
|
|
|
|
Hi Experts,
i want to download a file from Network with different domain with credentials of some particular user who has rights to access the file in destination computer..
for example i have a network system with ip:\\100.120.2.3 in that we have a file in d drive where it can be acessed by xyz user .Now my criteria is to download a file from that folder from my system by passing credentials of that particular xyz user in asp.net
Regards
venu
|
|
|
|
|
One solution is to make the container directory virtual and then change the web.config to restrict access to the file and/or the directory
Here[^] are a group of to get you started.
|
|
|
|
|
But i should pass the credentials in code and i should download a file instead of showing credentials to the user
|
|
|
|
|
hi guys
please help me to do it ...
i have a lot of mp3 and i want to add them and played them from project can i !?
its necessary to add it to resources or put it in dll and played ..
whats the good method to it
thanks a lot for help ...
|
|
|
|
|
Some suggestions here[^]; always try Google first.
|
|
|
|
|
thanks about answer ... but i can't found anything like this ..
I want to add mp3 file to resources project and from project played it ...
i found a lot example about how to played wav from project but mp3 all example about play from open dialog not from projects ...
who can help me int please ..
|
|
|
|
|
X9X wrote: mp3 all example about play from open dialog not from projects ...
There is no difference. You get a handle to a file and pass that to the player; if the MP3 is in a resource then you will need to create a temporary file or find some way to stream the data to the player. Check the documentation for the player(s) to see what options are available.
|
|
|
|
|
check this MSDN[^] link
***** Programme comme si dept soutien technique. est plein de tueurs en série et ils savent adresse de votre domicile. *****
|
|
|
|
|
I don't want my mp3 file accessible to anyone else.
I want to do the following in VisualStudio C#:
1. Right click my project and select -->Add Existing Item. Select my mp3 file.
2. Then in the Properties of my mp3 file change the Build Action to "Embedded Resource".
This now means that my mp3 file is contained inside my exe whenever its built.
But now I don't know how to access this mp3 file to played it. I can access (bitmaps ,gif, wave file) when they are embedded by using the code at the bottom my original post but it does not seem to work when I use it for the mp3 file.
Do you understand what my problem is?? Do you know how to solve it??
and this is the cod :
(for Images)
System.Drawing.Bitmap bitmap1 = resource.Properties.Resources.gif//(or bitmaps);
pictureBox1.Image = resource.Properties.Resources.gif;
(for wav)
SoundPlayer sndplayr = new SoundPlayer(resource.Properties.Resources.wav //(here mp3 not played ));
sndplayr.Play();
who can help me with it please ... i look for it but cant find any help ...
|
|
|
|
|
I want to check while the form load. if the user id is null i want to close the current page and open the login page. I know how to do it in web application. i am new to desktop application. so need help....
|
|
|
|