ThunderSpark91
✅ Need help fixing my C# Html Extraction Code
Found the sollution for my problem. The source of the problem was is that in my processing of the Mouse Over, there was text outside de <a> tag. By corecting the actual html string to the right format, I was able to get the InnerText more easily.
public static string ExtractMouseOverContent(string inputhtml) { // Define the regular expression to extract the onmouseover content string pattern = @"onmouseover=""([^""])"""; // Use Regex to match the pattern in the HTML string Match match = Regex.Match(inputhtml, pattern); // Check if the match was successful if (match.Success) { // Extract the content of the onmouseover attribute string onmouseoverContent = match.Groups[1].Value; // Further extract the text between 'return overlib(' and ', CAPTION' string innerPattern = @"return overlib('([^'])', CAPTION"; // Match the inner pattern to extract the relevant content Match innerMatch = Regex.Match(onmouseoverContent, innerPattern); if (innerMatch.Success) { string ExtraString = innerMatch.Groups[0].Value; string HyperLink = innerMatch.Groups[1].Value; string RemoveString = "</a>"; int Index = HyperLink.IndexOf(RemoveString); if (Index > 0) { HyperLink = HyperLink.Remove(Index, RemoveString.Length); HyperLink = HyperLink + RemoveString; HtmlDocument Link = new HtmlDocument(); Link.LoadHtml(HyperLink); var DataDocument = Link.DocumentNode; HyperLink = DataDocument.InnerText; } return HyperLink; } else { return inputhtml; } } else { return inputhtml; } }
3 replies
Entity Framework: Define a string computed Primary Key column in Data Annotations
Yeah but am working code first sort, I let Entity Framework make my database as soon as I got the stucture done and the data I am going to insert. but after looking into this I might look into querries do you happen to know that name of that library?
18 replies
Entity Framework: Define a string computed Primary Key column in Data Annotations
The First Program I am making myself as satrting point is ASP.NET API with public end points for other users and Private end points for my other applications.Do not know if need that part you just have described.
18 replies
IConfiguration using the json string/Data Model directly, instead of saving to a temporary file?
Yeah..this is why I am going to my alternative method? skipping configuration eternaly if I step oGf the Temp File Storage system. not using this one. I might wanna create a new topic later on that has to do with serilogger. But I will figure it out on my own for now.
30 replies
IConfiguration using the json string/Data Model directly, instead of saving to a temporary file?
public static IServiceCollection AddAPICore(this IServiceCollection serviceCollection, ApiCoreConfig apiConfig) => serviceCollection .AddSingleton(apiConfig) .AddSingleton<IConfigProvider, DefaultConfigProvider>() .AddAPICOREWithoutConfig();I already have the sollution for, god, I am such an idot it was staring me in the face.
30 replies