|
Did you even bother to search for free javascript spell checker? It took me seconds to find this[^] and this[^].
This space for rent
|
|
|
|
|
Drag and drop RichTextBox into form in the Form_Load and his running assign content for events RichTextBox_TextChanged RichTextBox but not running although I have to add this line of code:
this.RichTextBox.TextChanged + = new System.EventHandler (this.RichTextBox_TextChanged);
before Form_Load
[CODE]
public Form1()
{
InitializeComponent();
this.RichTextBox.TextChanged + = new System.EventHandler (this.RichTextBox_TextChanged);
this.Load += new System.EventHandler(this.Form1_Load);
}
private void RichTextBox_TextChanged (object sender, System.EventArgs e)
{
do something ...
}
[/ CODE]
as an example of his small examples on running normally, but in the main program will not run, I do not know what is not right ? What advice can you help me fix this.
|
|
|
|
|
You will have to be more specific than "the main program will not run". What do you mean by this? Are you seeing exceptions? If so, which ones are you seeing?
This space for rent
|
|
|
|
|
Hi,
I am trying to print Arabic receipt from Epson TM-T88V from VB.ET and C# application.
I have tried changing font, Epson settings for Arabic and all but it is not printing proper Arabic. It is printing as separation of Arabic alphabets not as a word.
Can someone please help me with this thing?
|
|
|
|
|
As fas as I understand you are using the printer's built-in font which is of poor quality.
Then the only solution to have a better font is to let Windows render a print image and send that to the printer in graphics mode (using the printer driver like with other printers). But this will usually take much more time to print.
|
|
|
|
|
|
Hello to everybody,
I have been struggling now for days on a part of the code i'am working on. And can not find the problem. Explain; If i make a new user on my admin panel everything goes well (It insert in the database), but wenn it comes to the 'verification email' it does not send it to the new user. I can verify manual the database (set 0 to 1), but that is not the way it should be. Strange is that if a user 'forgot' his password yes it is sending the new password with a verification link. I hope someone can help me out. Thanks in advance,
Here is a part off the code;
public ActionResult AddUser()
{
return View();
}
public ActionResult AddUserToDB(string name, string email, string pass, string level, string mode)
{
var lvl = (UserManager.Level)Enum.Parse(typeof(UserManager.Level), level);
var md = (UserManager.Mode)Enum.Parse(typeof(UserManager.Mode), mode);
UserManager.User user = new UserManager.User();
user.Name = name;
user.Email = email;
user.Password = PasswordHash.CreateHash(pass);
user.Level = lvl;
user.Mode = md;
user.ResetCode = "test";
user.ResetCodeUsed = false;
user.CreatedOn = DateTime.Now;
user.SignIP = "";
user.LastIP = "";
user.Status = UserManager.Status.Active;
if (user.Level == UserManager.Level.Agency)
{
user.Level = UserManager.Level.Elite;
user.Mode = UserManager.Mode.Agency;
}
UserManager.AddUser(user);
return RedirectToAction("Users");
}
[HttpPost]
public PartialViewResult UserSorting(string keyword, string icon, int page = 1)
{
ViewData["users"] = UserManager.GetUsers(page, ADMIN_LIMIT, keyword, icon);
int count = UserManager.GetUsersCount();
ViewBag.TotalItems = count;
ViewBag.PageLimit = ADMIN_LIMIT;
ViewBag.CurrentPage = page;
ViewBag.urlExpression = "/admin/users?keyword={0}&icon={1}&page={2}";
ViewBag.Sort = icon;
ViewBag.SortBy = keyword;
return PartialView("~/Views/Partials/_users.cshtml");
}
public ActionResult SignUp()
{
int u = Convert.ToInt32(TempData["user"]);
TempData.Keep();
if (u > 0)
{
return View("SignUp");
}
else
{
return PartialView("login");
}
}
[HttpPost]
public ActionResult SignUp(string name, string email, string password, string confirmpass, string level)
{
List<string> errors = new List<string>();
TempData["Name"] = name;
TempData["Email"] = email;
bool exist = UserManager.IsUserExisting(email.ToLower());
if (exist)
{
ViewBag.Errors = new List<string>() {
"This email exists in our records, please click <a href='/user/signin'>here</a> to login with this credentials."
};
return View();
}
ClickModels.UserManager.User user = new ClickModels.UserManager.User();
user.Name = name;
user.Email = email;
user.Password = PasswordHash.CreateHash(password);
user.Level = (UserManager.Level)Enum.Parse(typeof(UserManager.Level), level);
user.LastIP = Request.UserHostAddress;
user.LastLogin = DateTime.Now;
user.SignIP = Request.UserHostAddress;
user.Status = ClickModels.UserManager.Status.Active;
user.Verified = true;
user.ResetCode = Globals.RandomString(6);
user.CreatedOn = System.DateTime.Now;
user.ID = UserManager.AddUserByAdmin(user);
SendVerificationMail(user);
ViewBag.Done = true;
return View();
}
private void SendVerificationMail(UserManager.User user)
{
Task task = new Task(() =>
{
string eml = System.IO.File.ReadAllText(Server.MapPath("~/app_data/verifymail.txt"));
eml = eml.Replace("[username]", user.Name);
eml = eml.Replace("[appname]", Globals.APPNAME);
eml = eml.Replace("[vericode]", user.ResetCode);
eml = eml.Replace("[appurl]", Globals.APPURL);
eml = eml.Replace("[userid]", user.ID.ToString());
Globals.SendMail(user.Email, "Verify your " + Globals.APPNAME + " membership.", eml);
});
task.Start();
}
[HttpPost]
public ActionResult ChangeStatus(int id, string status)
{
UserManager.UpdateStatus(id, status);
return View();
}
[HttpPost]
public ActionResult ChangeLevel(int userID, string level)
{
UserManager.UpdateLevel(userID, level);
return View();
}
[HttpPost]
public ActionResult UpdateAd(string AdName, string Title, string subtitle, int userid)
{
AdManager.Ad ad = new AdManager.Ad();
ad.ID = userid;
ad.AdName = AdName;
ad.Title = Title;
ad.Subtitle = subtitle;
AdManager.UpdateParticularAd(ad);
return RedirectToAction("Userads", new { userid = userid });
}
}
}
|
|
|
|
|
It is really very hard to understand why,
Globals.SendMail(user.Email, "Verify your " + Globals.APPNAME + " membership.", eml);
fails in your application. But in any case, we are not able to help you out by just reading the code out. We need more information, such as the email address or the service being used.
In case of the email, what is the reason for it not being sent, or any error message? Did you try using the following code? In your own code, what happens is that the code creates a new task in the pool, and then returns a task object for that. However, as soon as the last line gets hit your reference is lost and (maybe, maybe...) your code is unable to proceed to send an email. That is why, I am going to write the code that actually waits for a task to finish.
Task task = Task.Run(() =>
{
string eml = System.IO.File.ReadAllText(Server.MapPath("~/app_data/verifymail.txt"));
eml = eml.Replace("[username]", user.Name);
eml = eml.Replace("[appname]", Globals.APPNAME);
eml = eml.Replace("[vericode]", user.ResetCode);
eml = eml.Replace("[appurl]", Globals.APPURL);
eml = eml.Replace("[userid]", user.ID.ToString());
Globals.SendMail(user.Email, "Verify your " + Globals.APPNAME + " membership.", eml);
});
task.Wait();
Read this as well, Task.Run Method (Action) (System.Threading.Tasks)
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello Afzaal Ahmad Zeeshan, first of all thank you for take the time&effort! I have implant your code and no error message,
I did not have received any 'error email' it just not send. I will show you a part of my web.config file, I use mailjet.com;
<appSettings>
<add key="admin:mail" value="******@gmail.com" />
<add key="admin:pass" value="*******" />
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="encryptkey" value="*****" />
<add key="encryptkeysuper" value="******" />
<add key="logpermdura" value="3" />
<add key="logtempdura" value="50" />
<add key="nomailwebsite" value="*****m@gmail.com" />
<add key="emailwebsite" value="*****@gmail.com" />
<add key="appurl" value="http://mar*******.club" />
<add key="app_name" value="GaxHopMSG" />
<add key="mailsmtp" value="in-v3.mailjet.com" />
<add key="maillogin" value="******************************" />
<add key="mailpass" value="******************************" />
<add key="mailport" value="25" />
<add key="permusercookie" value="clkperm" />
<add key="tempusercookie" value="clkmem" />
</appSettings>
Thank you,
|
|
|
|
|
Can you look in the control panel of MailJet services? I think the problem is somewhere on that side. Check if the email request received or not.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hi Afzaal Ahmad Zeeshan Thanks for your respond!, I have looked up on the control panel in Mailjet services, There were no 'email requests' exept for changing the password (That work like a charm)I have try with diferent emails, but no positive results. I do not know anymore what to do,
|
|
|
|
|
Then you need to debug why the email requests were not being sent at all. You will need to debug it, set breakpoints and see why code doesn't execute the statement.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Thank you Afzaal Ahmad Zeeshan, I need to learn how to set breakpoints (working on visual studio 2015)and then see why the code is execute the statement. It is realy hard to understand why it is not working, as i mentioned in previous post's the 'resett/forgottenpass is working well......
|
|
|
|
|
Hello. I have this backgroundTask whose output type is Windows Runtime Component .
I have absolutely no idea how to use this backgoundTask in my winform application. Basically this backgroundTask gets geolocation and retrieves long/lat. Here is the skeleton for reference
public sealed class LocationBackgroundTask : IBackgroundTask
{
async void IBackgroundTask.Run(IBackgroundTaskInstance taskInstance)
{
BackgroundTaskDeferral deferral = taskInstance.GetDeferral();
try
{
}
catch(Exception ex) { }
finally
{
deferral.Complete();
}
}
}
Again, I have no idea how do I use this runtime component from my winform application (a button will invoke this). This code is in one project and my winform application is second project.
Thanks for any input
|
|
|
|
|
Where did you find that code, or API? That requires you to involve Windows Runtime with Windows Forms? Although I am not saying that WinRT and .NET do not go well, they do and that is the beauty of C# itself.
But, what I wanted to know was, why would you need to do that, when there are many easy cases? Secondly, if an API does expose these types, then it would also expose some wrapper types, too. Are you a bit confused about the term, "component"?
Finally, as I can see, your IBackgroundTask.Run function has a void return type — void can be captured in .NET itself, no need for any Windows Runtime component. That looks like the default Windows Runtime background task interface, you should read a bit more about it here, Background Tasks in Windows Store Apps -- Visual Studio Magazine, it shows a good example of handling these background tasks. That will help you understand how it works.
Anyways, please do read this by Scott Hanselman as well, How to call WinRT APIs in Windows 8 from C# Desktop Applications - WinRT Diagram - Scott Hanselman
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: Where did you find that code, or API? It is a sample I downloaded somewhere on the web.
Afzaal Ahmad Zeeshan wrote: why would you need to do that, when there are many easy cases? Can you tell me those easy cases? I do not know.
|
|
|
|
|
Django_Untaken wrote: Can you tell me those easy cases? I do not know. One of them would be, to not expose the native typing in either of the cases. Use the types that can be used in both the runtimes.
Since you are writing a background task handler, there is no need to use Windows Runtime background task handler, you can do that in Windows Forms itself using .NET framework's Task API. Which is much more simpler and easier to use.
Task Class (System.Threading.Tasks)
Secondly, if you really do require to have a WinRT component, then make sure it exposes the type that .NET can consume natively; such as returning the string values, integer results etc. Since you only provide an interface implementation, it is very hard to tell what you want to do with that code.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
When my form design interface when editing files close and reopen frmMain.Designer.cs not see the look of the form, press Rebuil ..., press F5 or click Clear Solution no errors, press F5 to run normally, view form, but not the interface design in the form editor mode, in drafting VS screen and press select view designer frmMain.cs it his fault output stream to the attached word file, this case you can go back to the most recent edits or a way to view the form interface design? (Except sit redesigned from scratch) you view attachments error: http://www.mediafire.com/file/3fnke7btqaiab47/Error.doc
|
|
|
|
|
An error in a .doc file? With a description like that?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Instead of writing a stream-of-consciousness and posting it as a question, please try considering us as normal humans, who can't see your screen, access your HDD, or read your mind.
Try again, and use proper sentences and better explanations of exactly what you are doing, what you are seeing, and why it isn't what you wanted. The less you write, the more likely we are to misunderstand you, or not understand at all.
And if you want to show us an error message, copy and paste it into the post - never try to distribute anything via a DOC or DOCX file as these have been known to contain viruses or malicious macros, and it's very unlikely that anyone will download them.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: please try considering us as normal humans
Steady on there...
Regards,
Rob Philpott.
|
|
|
|
|
OriginalGriff wrote: considering us as normal humans
I got it covered!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Is this at all possible?
Consider these simplified classes:
static class Class1
{
internal static int GetValue(int First, int Second)
{
return First + Second;
}
}
static class Class2
{
internal static String GetSignatureFromMethod<TResult>(Func<TResult> Method)
{
String SomeCalculatedValue = A calculation depending on the existence of Val1, Val2 + the result of Method();
return SomeCalculatedValue;
}
}
class Program
{
static void Main(string[] args)
{
int Val1 = 3;
int Val2 = 4;
Func<int> Function = () => Class1.GetValue(Val1, Val2);
Console.WriteLine(Class2.GetSignatureFromMethod(Function));
Console.ReadKey();
}
}
I haven't found a way of doing this generically.
My searches indicate that it's not possible to do using reflection, at least not without deep knowledge of IL code.
|
|
|
|
|
No, not like that. By the time your Main gets to Class2.GetSignatureFromMethod the parameter values are no longer on the stack. They just don't exist anymore.
You've picked a very difficult problem that cannot be done without that knowledge of IL. The thing is that you have to grab the parameter values while the code is still in the method that you called. If you call ANY other method while the method your interrogating is running the stack gets deeper and you have to walk the stack to go get the correct parameter values. How far down the stack do you have to go? This is entirely dependent on your interrogation code.
|
|
|
|
|
Thanks for confirming.
Seems I'm stuck with a parameter array and/or a whole load of overloads for the GetSignatureFromMethod.
Or I have to get the architecture changed.
|
|
|
|
|