|
|
Hi,
use a System.Windows.Forms.Timer or read up on cross-thread issues e.g. here[^]
|
|
|
|
|
753/5000
Hello,
I wanted to recover data from an oracle 9i database. I work on 64 bit systems.
I downloaded the driver ODAC112040Xcopy_64bit in which I found .dlls (among which there is Oracle.DataAccess.dll) that I added them to a windows console application under visual studio 2012 and I added Oracle. DataAccess.dll as a reference in the application. So it works for recovery.
Now, I wanted to create a web service to do this recovery.
So, I created a project of type "ASP.NET Empty Web Application" for I added an element of type web service just that displays by default "Hello Wrold". When I compile and run the application then I get the following message:
Bonjour,
Je voulais récupérer des données à partir d'une base des données oracle 9i. Je travail sur des systèmes de 64 bit.
J'ai téléchargé le driver ODAC112040Xcopy_64bit dans lequel j'ai trouvé des .dll (parmi lequel il y a Oracle.DataAccess.dll) que j'ai les ajouté à une application windows console sous visual studio 2012 et j'ai ajouté Oracle.DataAccess.dll comme référence dans l'application. Alors ça marche pour la récupération.
Maintenant, je voulais créer un web service pour faire cette récupération.
Alors, j'ai crée un projet de type "ASP.NET Empty Web Application" pour j'ai ajouté un élément de type web service juste que affiche par défaut "Hello Wrold". Lorsque je compile et j’exécute l'application alors j'ai le message suivant :
Server error in application '/'.
Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.
Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information on the error and its origin in the code.
Exception details: System.BadImageFormatException: Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.
Source error:
An unhandled exception occurred while running the current web request. Information about the origin and location of the exception can be identified using the exception stack trace below.
Assembly load tracking: The following information can help determine why the assembly 'Oracle.DataAccess' could not be loaded.
=== Prior link status information ===
JRN: DisplayName = Oracle.DataAccess
(Partial)
AVT: partial link information has been provided for an assembly:
AVT: Assembly name: Oracle.DataAccess | Domain ID: 2
AVT: Partial binding occurs when only part of the full assembly name is provided.
AVT: This can cause the workbook to load an incorrect assembly.
AVT: it is recommended to provide a fully specified text identity for the assembly,
AVT: which includes the simple name, version, culture and public key token.
AVT: For more information and solutions to this problem, see the white paper at http://go.microsoft.com/fwlink/?LinkId=109270.
JRN: Appbase = file: /// D: / Development / Projects / WebApplicationWS / WebApplicationWS /
JRN: Initial PrivatePath = D: \ Development \ Projects \ WebApplicationWS \ WebApplicationWS \ bin
Assembly calling: (Unknown).
===
JRN: this link starts in the context of loading default.
JRN: use of the application configuration file: D: \ Development \ Projects \ WebApplicationWS \ WebApplicationWS \ web.config
JRN: use of the host configuration file:
JRN: use of the computer configuration file from C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ config \ machine.config.
JRN: strategy not applied to the reference at this stage (private, custom, partial or location-based assembly binding).
JRN: attempt to download the new URL file: /// C: /Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files / vs / b3838e6a / facd81ed / Oracle.DataAccess.DLL.
JRN: attempt to download the new URL file: /// C: /Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files / vs / b3838e6a / facd81ed / Oracle.DataAccess / Oracle.DataAccess.DLL .
JRN: attempt to download the new URL file: /// D: /Developpement/Projets/WebApplicationWS/WebApplicationWS/bin/Oracle.DataAccess.DLL.
ERR: unable to complete the installation of the assembly (hr = 0x8007000b). Detection completed.
Battery trace:
[BadImageFormatException: Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.]
System.Reflection.RuntimeAssembly._nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark & stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurity0
System.Reflection.RuntimeAssembly.nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark & stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Booleansressressecurity)
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName (AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark & stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection + BooleanSuppress15
System.Reflection.RuntimeAssembly.InternalLoad (String assemblyString, Evidence assemblySecurity, StackCrawlMark & stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80
System.Reflection.RuntimeAssembly.InternalLoad (String assemblyString, Evidence assemblySecurity, StackCrawlMark & stackMark, Boolean forIntrospection) +22
System.Reflection.Assembly.Load (String assemblyString) +29
System.Web.Configuration.CompilationSection.LoadAssemblyHelper (String assemblyName, Boolean starDirective) +39
[ConfigurationErrorsException: Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.]
System.Web.Configuration.CompilationSection.LoadAssembly
Erreur du serveur dans l'application '/'.
Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: System.BadImageFormatException: Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.
Erreur source:
Une exception non gérée s'est produite lors de l'exécution de la requête Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous.
Suivi du chargement de l'assembly: Les informations suivantes peuvent permettre de déterminer la raison pour laquelle l'assembly 'Oracle.DataAccess' n'a pas pu être chargé.
=== Informations d'état de liaison préalable ===
JRN : DisplayName = Oracle.DataAccess
(Partial)
AVT : des informations de liaison partielle ont été fournies pour un assembly :
AVT : Nom d'assembly : Oracle.DataAccess | ID de domaine : 2
AVT : une liaison partielle se produit lorsqu'une partie seulement du nom complet de l'assembly est fournie.
AVT : cela peut entraîner le chargement d'un assembly erroné par le classeur.
AVT : il est recommandé de fournir une identité textuelle complètement spécifiée pour l'assembly,
AVT : qui comprend le nom simple, la version, la culture et le jeton de clé publique.
AVT : pour plus d'informations et pour obtenir des solutions à ce problème, consultez le livre blanc à l'adresse suivante http://go.microsoft.com/fwlink/?LinkId=109270.
JRN : Appbase = file:///D:/Developpement/Projets/WebApplicationWS/WebApplicationWS/
JRN : PrivatePath initial = D:\Developpement\Projets\WebApplicationWS\WebApplicationWS\bin
Assembly appelant : (Unknown).
===
JRN : cette liaison démarre dans le contexte de chargement de default.
JRN : utilisation du fichier de configuration de l'application : D:\Developpement\Projets\WebApplicationWS\WebApplicationWS\web.config
JRN : utilisation du fichier de configuration d'hôte :
JRN : utilisation du fichier de configuration de l'ordinateur à partir de C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
JRN : stratégie non appliquée à la référence à ce stade (liaison d'assembly privée, personnalisée, partielle ou basée sur l'emplacement).
JRN : tentative de téléchargement de la nouvelle URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b3838e6a/facd81ed/Oracle.DataAccess.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vs/b3838e6a/facd81ed/Oracle.DataAccess/Oracle.DataAccess.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///D:/Developpement/Projets/WebApplicationWS/WebApplicationWS/bin/Oracle.DataAccess.DLL.
ERR : impossible de terminer l'installation de l'assembly (hr = 0x8007000b). Détection terminée.
Trace de la pile:
[BadImageFormatException: Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +37
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +159
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
System.Reflection.Assembly.Load(String assemblyString) +29
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +39
[ConfigurationErrorsException: Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +777
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +229
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +140
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +176
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +99
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +310
System.Web.Compilation.BuildManager.ExecutePreAppStart() +165
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +590
[HttpException (0x80004005): Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10082160
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +464
Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.8.4110.0
|
|
|
|
|
This is an English language site, and we can only answer questions posted in that language. Please use Google Translate to convert your message before posting in future.
But the error message is pretty clear:
Unable to load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load an incorrect format program.
At a guess, the Oracle DB engine is missing (or at least partially missing), configured for 32 bit when the system is 64, or vice versa, etc. Eitehr way, this isn;t somethign we can really help you with.
Start by contacting your hosting service and ask them if they have had this problem before - they may be able to shortcut the process of working out exactly what you have done.
Il s'agit d'un site en anglais et nous ne pouvons répondre qu'aux questions publiées dans cette langue. Veuillez utiliser Google Translate pour convertir votre message avant de poster à l'avenir.
Mais le message d'erreur est assez clair:
Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou l'une de ses dépendances. Une tentative de chargement d'un programme au format incorrect a été effectuée.
À une supposition, le moteur Oracle DB est manquant (ou au moins partiellement manquant), configuré pour 32 bits lorsque le système est à 64, ou vice versa, etc. De toute façon, ce n'est pas le cas, nous pouvons vraiment vous aider.
Commencez par contacter votre service d'hébergement et demandez-leur s'ils ont déjà rencontré ce problème - ils pourront peut-être raccourcir le processus d'élaboration de ce que vous avez fait.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
When you get a BadImageFormat exception, it usually means you're trying to mix 32 and 64-bit code in the same process.
From your description, you are probably trying to use a 64-bit .DLL in a 32-bit app, or your code is running as 32-bit instead of 64.
|
|
|
|
|
|
Considering you never said what change you made and what the IIS app and app pool settings currently are, there's nothing anyone can tell you.
|
|
|
|
|
Bonjour,
le driver Oracle Data Access de version 64 bits
Lorsque je crée un application console çà marche pour le driver.
Lorsque je crée une application web asp.net alors le driver ne fonctionne. Les propriétés de cette application :
- target framework 4.0
- Platform target : any CPU
J'ai changé "any cpu" par "X86" mais le même problème puis avec "X64" aussi le même problème
- le web : J'ai coché l'option "use Visual Studio Development Server"
au lieu de "use Local IIS Web Serve"
|
|
|
|
|
Translated:
Quote: Hello
Oracle Data Access driver of 64-bit version
When I create a console app it works for the driver.
When I create a web application asp.net then the driver does work. The properties of this application:
- target framework 4.0
- Platform target: any CPU
I changed 'any cpu' to 'X86' but the same problem then with 'X64' also the same problem
- the web: I checked the option "use Visual Studio Development Server"
instead of "use Local IIS Web Serve"
A console app is not an ASP.NET app. They work in completely different ways.
A platform target of "AnyCPU" runs, by default either as the CPU architecture on older versions of .NET or as a 32-bit app.
Changing the platform target to "X86" forces the app to run as 32-bit only, even on a 64-bit machine.
Change the target to x64 to match the architecture of the .DLL's you're using. In IIS, in the Application Pool you are running your code under, under Advanced Options, there is an option to run the app as a 32-bit app instead of 64-bit. If that setting is turned on, your code will run as 32-bit instead of 64-bit.
Also, you MUST install the Oracle Client on the IIS server in order for Oracle database access to work.
modified 11-Jun-20 12:16pm.
|
|
|
|
|
Je vous informe que dans les paramètres avancés de pool application que l'option " activer les applications 32 bits" est déja comme valeur "false"
j'ai changé "Platform target" à X86
mais le même message d'erreur.
Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess' ou une de ses dépendances. Tentative de chargement d’un programme de format incorrect.
|
|
|
|
|
Translated:
Quote: I inform you that in the advanced application pool settings that the option "activate 32-bit apps" is already as "false"
I changed "Platform target" to X86
but the same error message.
Can't load the 'Oracle.DataAccess' file or assembly or any of its dependencies. Attempting to load an incorrectly format program.
Uhhh... I just got done telling you that x86 means "32-bit" and running 32-bit code in the App Pool is turned OFF. Change the platform target back to x64.
Now, if you're deploying just a single Oracle .DLL with your app, you're definitely doing it wrong. Oracle requires and entire Client installation in order to work. Just deploying one of two .DLL's with Oracle in the name will NOT WORK.
modified 11-Jun-20 12:17pm.
|
|
|
|
|
Bonjour,
J'ai téléchargé le dossier .zip ODAC112040Xcopy_32bit et ODAC112040Xcopy_64bit
Est ce que je dois utiliser ODAC 32bit ou bien ODAC 64bit ?
Ce dossier contient plusieurs types de dll
alors quel(s) .dll à ajouter dans mon projet ?
|
|
|
|
|
Translated:
Quote: Hello
I downloaded the .zip folder ODAC112040Xcopy_32bit and ODAC112040Xcopy_64bit
Do I have to use ODAC 32bit or ODAC 64bit?
This folder contains several types of dll
so what .dll to add to my project?
You're doing this all wrong. You don't just add a .DLL to your project. Oracle does not work that way. Forget what you downloaded.
You have to install the Oracle Client and add ODP.NET to your project through the Nuget Package Manager under the Tools menu in Visual Studio. In NPM, search for "ODP.NET4" and add that to your project.
When deploying your application to a server, that server must also have the Oracle Client installed else your application will not work.
|
|
|
|
|
Actually, the XCopy installation of Oracle client should work if you add all the files to the bin folder.
But only if you don't have another installation with another bitness.
|
|
|
|
|
Bonjour,
J'ai téléchargé "ODAC112040Xcopy_32bit" et j'ai copié les .dll necessaires dans mon projet et j'ai ajouté le driver "Oracle.DataAccess.dll" dans la partie reference de mon projet. J'ai target platform avec 32 bit.
Après compilation et exécution, alors le driver a été bien chargé mais je ne peux pas connecter au base oracle sachant que de version 9i et lire le contenu d'une table.
J'ai le message suivant :
System.TypeInitializationException: Une exception a été levée par l'initialiseur de type pour 'Oracle.DataAccess.Client.OracleConnection'. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
à Oracle.DataAccess.Client.OracleInit.Initialize()
à Oracle.DataAccess.Client.OracleConnection..cctor()
--- Fin de la trace de la pile d'exception interne ---
à Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
à WebServiceToBD.Service1.view_data() dans d:\Developpement\SiteVs2012\WebServiceToBD\Service1.asmx.cs:ligne 48
Voici le code de méthode :
public DataTable view_data()
{
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
conn.Open();
OracleDataAdapter dr = new OracleDataAdapter("select * from Personne", conn);
DataSet ds = new DataSet();
ds.Tables.Add("Personne");
dr.Fill(ds,"Personne");
DataTable tt = ds.Tables[0];
return tt;
}
<pre lang="c#">
La ligne 48 correspond au code suivant :
<pre lang="c#">OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ***)));User ID=***;Password=***");
Cette chaîne de connexion existe dans le programme et pas dans le fichier "Web.config".
modified 12-Jun-20 3:54am.
|
|
|
|
|
When you are using unmanaged code (the Oracle Client in this case), EVERYTHING need to have the same bitness (32 or 64 bits), including the client, debugger, IIS Application pool and the VSHost.exe.
More info on that here: Visual Studio Debugging and 64 Bit .NET Applications - Rick Strahl's Web Log[^]
In this case I'm not even sure if you have the same bitness on the Oracle.DataAccess.dll and the rest of the client files.
You can use corflags.exe to determine bitness of an .exe
|
|
|
|
|
Thanks it works for the driver.
I used this driver in a .net web service. Then I will call this web service in another asp net project. The web service call and the data recovery work on a table with a reduced number of lines.
Now, I wanted to retrieve the contents of a table that contains 1844 rows and 58 columns.
After compilation and execution, I have the following message:
Server error in application '/'.
The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information on the error and its origin in the code.
Exception details: System.ServiceModel.QuotaExceededException: The maximum size quota allowed for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
modified 12-Jun-20 9:17am.
|
|
|
|
|
|
Erreur du serveur dans l'application '/'.
Le quota de taille maximale autorisée pour les messages entrants (65536) a été dépassé. Pour augmenter le quota, utilisez la propriété MaxReceivedMessageSize sur l'élément de la liaison appropriée.
Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.
Détails de l'exception: System.ServiceModel.QuotaExceededException: Le quota de taille maximale autorisée pour les messages entrants (65536) a été dépassé. Pour augmenter le quota, utilisez la propriété MaxReceivedMessageSize sur l'élément de la liaison appropriée.
|
|
|
|
|
Random random = new Random();
int character = 15;
int mobhp = 3;
Console.WriteLine("You are an adventuurer.");
Console.WriteLine("you are walking across the forest when suddenly you encounter a");
string [] monster = {"imp", "goblin", "hobgoblin",};
string monsters = (monster[(random.Next(0, 3))]);
Console.WriteLine(monsters);
switch (monsters){
case "goblin":
mobhp = 11;
break;
case "imp":
mobhp = 8;
break;
case "hobgoblin":
mobhp = 15;
break;
}
string entry = Console.ReadLine();
string hit = "attack";
string regenerate = "heal";
string escape = "run";
switch (entry){
case "hit":
mobhp = mobhp - 4;
Console.WriteLine("You attacked it!");
break;
case "regenerate":
character = character + 2;
Console.WriteLine("you heald 2 hp");
break;
case "escape":
Console.WriteLine("you cant run away!");
break;
|
|
|
|
|
Have you tried putting your questions and answers in a loop that terminates when mobhp is <= 0?
|
|
|
|
|
Hi every body
I've question about thread.
My project get data from IO (use control InstantDiCtrl of Advanetect)
Code: InstantDiCtrl.ReadPort(0, ref data)
When I code on timer function data can get.
but when I code on thread can not get data (always output 0)
What diffrent about thread and timers.
Thank you
|
|
|
|
|
You can't compare threads and timers: that's like comparing electricity to an orange.
A thread is a separately executing "chunk" of code with its own stack which operates independently within a process but which shares common memory with other threads in the process.
A timer is a (fairly) regular event which happens within a thread at an interval.
You need to look at your code - both thread and timer - to work out why your threaded version doesn't work. We can't do that as we have no access to your code other than exactly what you show us - and your code fragment is useless out of context. Do remember that threads cannot access any Controls directly: trying will get you a cross threading exception. Timers don;t have this problem as they run within the thread that created the Timer object.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You can't access/use controls/variables from different threads. Your normal application is the main-thread, and within it, you can access all that you create there. The timer interrupts execution of that mainthread to execute the timed code with that thread.
If you create a new thread, then this will run seperately from the mainthread, without interrupting it. That's the preferred way, but you'd need to read up on how to synchronize your data with the mainthread.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hello, I'm currently making a program that will take a HEX string and convert it into an image.
I talked to a experienced coder and he gave me some steps to my problem:
1) Create a simple hello world program with a main method
2) Make it so your program can print out the byte array you input to the console
3) Figure out how to link in the libraries the code you posted references (looks like SkiaSharp and PakReader)
4) Make the call to the code you showed (TextureDecoder.DecodeImage)
5) Write the resulting SKImage to a file
I'm trying to call a method from a separate program. I'm really inexperienced and confused even after looking at documentation and multiple YT videos.
I had a couple of questions about how I should do this:
I'm trying to call
TextureDecoder.DecodeImage
from the program in the link below.
hastebin[^]
MY current code so far, based off of the first 3 Steps a guy gave me for help:
using System;
using System.IO;
using PakReader.Parsers.Objects;
using SkiaSharp;
namespace EncyptedViewing
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("HEX Input");
}
}
}
I would like to know how I would call the class from the link above TextureDecoder.DecodeImage into the program above, or is that not possible and I need to do it all in one program?
Thanks, and stay safe.
|
|
|
|
|