|
What is your question about scrolling text?
|
|
|
|
|
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?
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 - we only get exactly what you type to work with.
And to be honest, even for student grade code, that's really very poor quality! Stop using default names for controls, use an enum instead of a string based mode , use a switch instead of if ... else if ... else if ... and think about what you are doing:
if (mode == "SoSa")
{
...
}
else if (mode == "SaSo")
{
...
}
if (mode == "Asagi")
{
...
}
else if(mode == "Yukari")
{
...
} What if it is none of them?
Shouldn't that be
else if (mode == "Asagi")
Don't use the text of a button to determine what it does: use the Tag field instead - it can hold any type so a bool would be more appropriate.
Don't use string literals directly in code anyway: "DUR" and "DEVAM" should be constant values not inline literals, so if they change at a later date to - say - "Dur" and "Devam" they only need changing in one place.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Cordial saludo equipo de Programacion.net les escribe Hernán Martínez saludos desde Colombia, agradezco si me pueden colaborar acerca del inconveniente que tengo respecto a la apertura de una página web que tengo desarrollada haciendo uso de los lenguajes de programación C# ASP.Net:
Antes tengo que aclarar que tengo varias paginas de similar desarrollo dentro de mi proyecto en donde hago uso de la función MessageBox.show
Pero al abrir esta pagina mediante un hiperenlace o hipervínculo me muestra el siguiente error:
Error de servidor en la aplicación '/'.
________________________________________
Error de compilación
Descripción: Error durante la compilación de un recurso requerido para dar servicio a esta solicitud. Revise los detalles de error específicos siguientes y modifique el código fuente en consecuencia.
Mensaje de error del compilador: CS0103: The name 'MessageBox' does not exist in the current context
He visto foros en donde aclaran ese inconveniente y las soluciones que me plantean es:
• Que haga lo mismo, pero en Javascript
• Que utilice Alerts en vez de MessageBox
• Que incluya la referencia System.Windows.Forms y que incluya
using System.Windows.Forms;, cosa que he hecho pero que no he tenido éxito.
La idea como es obvia es que me sirva con la función ‘MessageBox’, como me sirve en las otras páginas de mi proyecto.
Muchas gracias por la colaboración que me puedan brindar
|
|
|
|
|
As stated below, this is an English language site. Please translate your messages.
|
|
|
|
|
Here is the Google Translate for the message:
Cordial greeting team of Programacion.net writes hernán Martínez greetings from Colombia, I appreciate if you can help me about the inconvenience I have regarding the opening of a website that I have developed using the programming languages of ASP.Net:
First I have to clarify that I have several pages of similar development within my project where I make use of the MessageBox.show function
But opening this page using a hyperlink or hyperlink shows me the following error:
Server error in application '/'.
________________________________________
Build failed
Description: An error occurred while compiling a resource required to service this request. Review the specific error details below and modify the source code accordingly.
Compiler error message: CS0103: The name 'MessageBox' does not exist in the current context
I have seen forums where they clarify this inconvenience and the solutions they pose to me is:
• Do the same, but in Javascript
• Use Alerts instead of MessageBox
• Include the System.Windows.Forms reference and include
using System.Windows.Forms;, which I have done but have not been successful.
The idea as is obvious is that it serves me with the 'MessageBox' function, as it serves me on the other pages of my project.
Thank you very much for the collaboration you can give me
It looks like the requester is trying to display messages on a web page but is using MessageBox which is not a JavaScript method. He / she says it works on other pages of the project. He / she should look at the other pages in the project and see what they are doing that is different from what is being done on the page he / she is working on.
|
|
|
|
|
This is a common problem where people build on their own systems and it appears to work (client and server on the same platform). But as soon as they deploy it falls over. As that famous scene in Cool Hand Luke has it, "What we have here is a failure to communicate".
|
|
|
|
|
Websites ... so many problems unless you understand what is going on ...
There are two major components to a website: the Front end and the Back end.
The Front end is written in Javascript / HTML and executes on the Client computer within his browser.
The Back end is written in C# (or VB, or PHP) and executes on the Server computer within the web server software.
And that means that when you call MessageBox you are executing code on the Server, not the Client - and even if MessageBox is installed on eth Server, the message would display there, not on the Client browser.
It appears to work in development because the Server and Client are both running on the same machine - the server MessageBox pops up and it looks fine because nothing indicates where it's from.
In production, they aren't the same computer, and the MessageBox (if any) will pop up on the Server (which probably doesn't have a display, and even if it did nobody is looking at it) so the Client just appears to freeze and the page times out without responding.
To pop up a message on the browser, you have to insert the Javascript code into your HTML page and send it to the client as normal: Window alert() Method[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Cordial saludo equipo de StackoverRun les escribe Hernán Martínez saludos desde Colombia, agradezco si me pueden colaborar acerca del inconveniente que tengo respecto a la apertura de archivos almacenados en una base de datos SQL server mediante el lenguaje de programación C# ASP.Net:
El video explicativo de mi requerimiento es el siguiente:
https:
Y el código es el siguiente
protected void gvContact5_SelectedIndexChanged(object sender, EventArgs e)
{
string IdMov = Convert.ToString(gvContact5.DataKeys[gvContact5.SelectedIndex].Value.ToString());
string query = "select * from compyrifas where idmov = @IdMov";
var cmd = new SqlCommand(query, sqlCon5);
cmd.Parameters.AddWithValue("@IdMov", IdMov);
var DA5 = new SqlDataAdapter(cmd);
DataTable dtbl = new DataTable();
DA5.Fill(dtbl);
if ((dtbl.Rows.Count == 0) || (dtbl.Rows[0]["doc"] == DBNull.Value))
{
MessageBox.Show("Favor vuelva al formulario de Compras_y_rifas e inserte el correspondiente documento en el campo con nombre --Documento_escaneado-- para subir el documento");
}
else
{
string filenm = dtbl.Rows[0]["realname"].ToString();
var doc = (byte[])dtbl.Rows[0]["doc"];
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
if (filenm.Trim().EndsWith(".pdf"))
{
Response.ContentType = "\".pdf\", \"application/pdf\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".HTM") || filenm.Trim().EndsWith(".HTML"))
{
Response.ContentType = "\".html\", \"application/html\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".TIF"))
{
Response.ContentType = "\".tiff\", \"application/tiff\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".jpeg") || filenm.Trim().EndsWith(".JPG"))
{
Response.ContentType = "\".jpeg\", \"application/jpeg\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".doc") || filenm.Trim().EndsWith(".docx"))
{
Response.ContentType = "\".doc\", \"application/msword\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".xls") || filenm.Trim().EndsWith(".xlsx"))
{
Response.ContentType = "\".xls\", \"application/msexcel\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".accdb") || filenm.Trim().EndsWith(".mdb"))
{
Response.ContentType = "\".accdb\", \"application/msAccess\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
else if (filenm.Trim().EndsWith(".ppt") || filenm.Trim().EndsWith(".pptx"))
{
Response.ContentType = "\".ppt\", \"application/msPowerPoint\"";
Response.AddHeader("Content-disposition", "attachment; filename=" + filenm);
Response.BinaryWrite(doc);
Response.End();
}
}
}
Muchas gracias por su colaboración.
Att. Hernán Martínez
Bogotá D.C – Colombia
|
|
|
|
|
Please post in English ... use Google translator if necessary.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Hello everybody, this is my first message on this forum.
I have this code for click in a specific position xy, works fine, but I'd like click without use user mouse, what is the correct way? thanks!
current code with real movement:
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern bool SetCursorPos(int x, int y);
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private static void LeftMouseClick(int Xposition, int Yposition)
{
SetCursorPos(Xposition, Yposition);
mouse_event(MOUSEEVENTF_LEFTDOWN, Xposition, Yposition, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, Xposition, Yposition, 0, 0);
SetCursorPos(935, 535);
}
source code:
https://www.codeproject.com/Articles/32556/Auto-Clicker-C
|
|
|
|
|
Is there any reason why you aren't asking this in the forum at the end of the article you got the code from? The original author will be a lot more familiar with his code than we will.
(And he might have a vague idea what the heck you are going on about: I don't have a clue ... remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. That code doesn't need a "real" mouse.)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks for the kind welcome However I no asked at the end of article because this code move cursor, instead I'd like click without any cursor movements of user.
Thanks same
|
|
|
|
|
When a user clicks the mouse, it triggers an event. Your code runs an event handler in response to the event. If the code in the event handler is extracted out into a separate routine, the event handler can then just call the extracted code routine. Then, your click-without-using-the-mouse (which I presume is activated by something that you have written) can just call the same extracted code routine.
|
|
|
|
|
This is usually the way to do it.
If you generalize it slightly, it may not always work: Especially if we are talking about a hardware level handler, reacting to interrupts, the interrupt handler may have access to hardware registers etc. that you cannot access from an ordinary background level (or whatever it is called in your local lore). The interrupt handler may have access to both physical registers, privileged instructions and protected memory that user code does not.
The handler may call a user space/level function accessible to application code as well, but information provided to this function may come from a privileged context. You may or may not be able to provide valid "fake values" from your user level context. Also, operations performed by this extracted function may require hardware privileges not available in a user level context.
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Speech;
using System.Speech.Synthesis;
using System.Speech.Recognition;
using System.Threading;
using System.Diagnostics;
namespace PC_AI_BOT_2020
{
public partial class Form1 : Form
{
// form declarations...
SpeechSynthesizer ss = new SpeechSynthesizer();
PromptBuilder pb = new PromptBuilder();
SpeechRecognitionEngine sre = new SpeechRecognitionEngine();
Choices clist;
public Form1()
{
InitializeComponent();
}
private void Btnstart_Click(object sender, EventArgs e)
{
// start (button_click)
btnstart.Enabled = false;
btnstop.Enabled = true;
clist.Add(new string[] { "hello", "how are you", "what is the current time", "open crome", "thanks you", "close" });
Grammar gr = new Grammar(new GrammarBuilder(clist));
try
{
sre.RequestRecognizerUpdate();
sre.LoadGrammar(gr);
sre.SpeechRecognized += Sre_speechrecognized;
sre.SetInputToDefaultAudioDevice();
sre.RecognizeAsync(RecognizeMode.Multiple);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "error");
}
}
void Sre_speechrecognized(Object sender, SpeechRecognizedEventArgs e)
{
switch (e.Result.Text.ToString())
{
case "hello":
ss.SpeakAsync("hello marcus");
break;
case "how are you today":
ss.SpeakAsync("i am doing grate marcus how about you");
break;
case "wht is the current time":
ss.SpeakAsync("current time is " + DateTime.Now.ToLongTimeString
());
break;
case "thank you":
ss.SpeakAsync("pleasure is mine marcus");
break;
case "open crome":
Process.Start("crome", "http;//www.google.com");
break;
case "close":
Application.Exit();
break;
}
txtcontents.Text += e.Result.Text.ToString() + Environment.NewLine;
}
private void Btnstop_Click(object sender, EventArgs e)
{
// stop (button_click )
sre.RecognizeAsyncStop();
btnstart.Enabled = true;
btnstop.Enabled = false;
}
}
}
|
|
|
|
|
What error?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
And if you get a problem with Youtube code, then two things spring to mind:
1) Talk to the idiot who posted the tutorial: it's his code, he should know how it works. He probably won't, as most Youtube tutorials are produced by people who have no idea what they are doing, but at least it warns others ...
2) If code doesn't work, start with the debugger and see what is going on while it is running.
But just posting a chunk of random code and saying "it doesn't work" when we have no idea what it is supposed to do in the first place is an exercise in futility ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
What error?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Quote: Let me know best practices for audit data handling.
|
|
|
|
|
Better than what?
we have no idea what you are doing, or how you are handling it at the moment, so we couldn't begin to compare practices if we wanted to ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Write triggers or use the transaction log.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
The best practice is to do it correctly. So use Google to find samples and tutorials on the subject and study them closely.
|
|
|
|
|
Richard MacCutchan wrote: The best practice is to do it correctly. Can you back up that opinion with any fact?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
|
Hello.
My Name is Ko.
I want to make mapping drive use ftp/sftp.
What kind of dll can help me?
I used dokan, but I failed.
So. I find cNetworkDrive.
[https://www.codeproject.com/Articles/6847/Map-Network-Drive-API]
But this project has only share folder.
Help me plz.
|
|
|
|
|
You can't map a FTP link to a drive: they use different protocols.
To access an FTP link, you need to use an FTP client - I use FileZilla[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|